mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2025-04-21 15:26:17 -04:00
Use Events class for handling visibilitychange
This commit is contained in:
parent
29bd778757
commit
9543c47900
1 changed files with 2 additions and 2 deletions
|
@ -438,10 +438,10 @@ class Notifications {
|
|||
const visibilitychangeHandler = () => {
|
||||
if (document.visibilityState === 'visible') {
|
||||
notification.close();
|
||||
document.removeEventListener('visibilitychange', visibilitychangeHandler);
|
||||
Events.off('visibilitychange', visibilitychangeHandler);
|
||||
}
|
||||
};
|
||||
document.addEventListener('visibilitychange', visibilitychangeHandler);
|
||||
Events.on('visibilitychange', visibilitychangeHandler);
|
||||
|
||||
return notification;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue