mirror of
https://github.com/RobinLinus/snapdrop.git
synced 2025-05-15 23:20:11 -07:00
Use Events class for handling visibilitychange
This commit is contained in:
parent
29bd778757
commit
9543c47900
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user