mirror of
https://github.com/schlagmichdoch/PairDrop.git
synced 2026-04-18 15:22:16 +00:00
Use Events class for handling visibilitychange
This commit is contained in:
@@ -438,10 +438,10 @@ class Notifications {
|
|||||||
const visibilitychangeHandler = () => {
|
const visibilitychangeHandler = () => {
|
||||||
if (document.visibilityState === 'visible') {
|
if (document.visibilityState === 'visible') {
|
||||||
notification.close();
|
notification.close();
|
||||||
document.removeEventListener('visibilitychange', visibilitychangeHandler);
|
Events.off('visibilitychange', visibilitychangeHandler);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
document.addEventListener('visibilitychange', visibilitychangeHandler);
|
Events.on('visibilitychange', visibilitychangeHandler);
|
||||||
|
|
||||||
return notification;
|
return notification;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user