add notification on connect

This commit is contained in:
schlagmichdoch 2023-01-07 01:45:52 +01:00
parent 62b9e4e9e4
commit fe2422264a
2 changed files with 17 additions and 7 deletions

View file

@ -23,7 +23,7 @@ class PeersUI {
Events.on('peers', e => this._onPeers(e.detail));
Events.on('file-progress', e => this._onFileProgress(e.detail));
Events.on('paste', e => this._onPaste(e));
Events.on('disconnect', _ => this._clearPeers());
Events.on('ws-disconnect', _ => this._clearPeers());
this.peers = {};
}
@ -523,8 +523,9 @@ class Notifications {
class NetworkStatusUI {
constructor() {
Events.on('offline', this._showOfflineMessage);
Events.on('online', this._showOnlineMessage);
Events.on('offline', _ => this._showOfflineMessage());
Events.on('online', _ => this._showOnlineMessage());
Events.on('ws-connected', _ => this._showOnlineMessage());
if (!navigator.onLine) this._showOfflineMessage();
}