mirror of
https://github.com/smogon/pokemon-showdown-client.git
synced 2026-08-25 12:29:57 -05:00
Display desktop notification on disconnect
This commit is contained in:
@@ -429,6 +429,11 @@
|
||||
});
|
||||
|
||||
this.on('init:socketclosed', function () {
|
||||
// Display a desktop notification if the user won't immediately see the popup.
|
||||
if ((self.popups.length || !self.focused) && window.Notification) {
|
||||
self.rooms[''].requestNotifications();
|
||||
new Notification("Reconnect to Showdown!", {lang: 'en', body: "You have been disconnected \u2014 possibly because the server was restarted."});
|
||||
}
|
||||
self.reconnectPending = true;
|
||||
if (!self.popups.length) self.addPopup(ReconnectPopup);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user