minor tweaks

This commit is contained in:
or-else
2023-03-14 09:44:54 -07:00
parent 323042bd96
commit 43798ea1d9
7 changed files with 19 additions and 10 deletions
+6 -2
View File
@@ -277,8 +277,10 @@ class TinodeWeb extends React.Component {
componentDidMount() {
window.addEventListener('resize', this.handleResize);
window.addEventListener('online', (e) => { this.handleOnline(true); });
window.addEventListener('offline', (e) => { this.handleOnline(false); });
this.handleOnlineOn = _ => { this.handleOnline(true); }
window.addEventListener('online', this.handleOnlineOn);
this.handleOnlineOff = _ => { this.handleOnline(false); }
window.addEventListener('offline', this.handleOnlineOff);
window.addEventListener('hashchange', this.handleHashRoute);
// Process background notifications from the service worker.
@@ -354,6 +356,8 @@ class TinodeWeb extends React.Component {
componentWillUnmount() {
window.removeEventListener('resize', this.handleResize);
window.removeEventListener('hashchange', this.handleHashRoute);
window.removeEventListener('online', this.handleOnlineOn);
window.removeEventListener('offline', this.handleOnlineOff);
document.removeEventListener('visibilitychange', this.handleVisibilityEvent);
}