From 800cf1712cabda98115b1a97d0ff079e812cdbcd Mon Sep 17 00:00:00 2001 From: schlagmichdoch Date: Sat, 24 Dec 2022 04:28:41 +0100 Subject: [PATCH] restart animation when last peer leaves --- public/scripts/ui.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/scripts/ui.js b/public/scripts/ui.js index f70eb7b..c6b15a1 100644 --- a/public/scripts/ui.js +++ b/public/scripts/ui.js @@ -24,6 +24,7 @@ class PeersUI { Events.on('file-progress', e => this._onFileProgress(e.detail)); Events.on('paste', e => this._onPaste(e)); Events.on('offline', () => this._clearPeers()); + Events.on('online', () => window.animateBackground(true)); this.peers = {}; } @@ -46,6 +47,7 @@ class PeersUI { const $peer = $(peerId); if (!$peer) return; $peer.remove(); + setTimeout(e => window.animateBackground(true), 1750); // Start animation again } _onPeerLeft(peerId) {