mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
fix: cancel copy file button effect properly
This commit is contained in:
parent
19c41d1005
commit
5156e6b970
1 changed files with 8 additions and 6 deletions
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue