mirror of
https://github.com/EnixCoda/Gitako.git
synced 2026-03-11 08:54:44 +00:00
feat(SideBar): remove event listeners when unmount
although Gitako do not unmount before page unload
This commit is contained in:
parent
817b173370
commit
85f83decef
1 changed files with 6 additions and 0 deletions
|
|
@ -83,6 +83,12 @@ export default class SideBar extends React.Component {
|
|||
}
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener('pjax:send', this.onPJAXStart)
|
||||
window.removeEventListener('pjax:complete', this.onPJAXEnd)
|
||||
window.removeEventListener('keydown', this.onKeyDown)
|
||||
}
|
||||
|
||||
onPJAXStart = () => {
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue