fix: cancel copy file button effect properly

This commit is contained in:
EnixCoda 2020-04-01 23:57:03 +08:00
parent 19c41d1005
commit 5156e6b970
No known key found for this signature in database
GPG key ID: 0C1A07377913A1DD

View file

@ -127,12 +127,14 @@ export function attachCopyFileBtn() {
buttonGroup.appendChild(button)
}
})
return () => {
const buttons = document.querySelectorAll(`.${copyFileButtonClassName}`)
buttons.forEach(button => {
button.parentElement?.removeChild(button)
})
}
}
// return callback so that disabling after redirecting from file page to non-page works properly
return () => {
const buttons = document.querySelectorAll(`.${copyFileButtonClassName}`)
buttons.forEach(button => {
button.parentElement?.removeChild(button)
})
}
}