dev_ec^2
hjm 6 years ago
parent bf97b69a8b
commit b09f0f1d9d

@ -320,6 +320,9 @@ class studentsList extends Component{
isAdmin && on('updateNavSuccess', this.updateNavSuccess) isAdmin && on('updateNavSuccess', this.updateNavSuccess)
} }
componentWillUnmount() { componentWillUnmount() {
if (this.clipboard) {
this.clipboard.destroy()
}
const isAdmin = this.props.isAdmin() const isAdmin = this.props.isAdmin()
if (isAdmin) { if (isAdmin) {
off('addStudentSuccess', this.addStudentSuccessListener) off('addStudentSuccess', this.addStudentSuccessListener)
@ -420,6 +423,7 @@ class studentsList extends Component{
invite_code: result.data.invite_code, invite_code: result.data.invite_code,
isSpin:false isSpin:false
}, () => { }, () => {
if (course_group_id) {
if (!this.clipboard) { if (!this.clipboard) {
const clipboard = new ClipboardJS('.copybtn'); const clipboard = new ClipboardJS('.copybtn');
clipboard.on('success', (e) => { clipboard.on('success', (e) => {
@ -427,6 +431,7 @@ class studentsList extends Component{
}); });
this.clipboard = clipboard this.clipboard = clipboard
} }
}
}) })
} }
}).catch((error)=>{ }).catch((error)=>{

Loading…
Cancel
Save