fix animation function if called multiple times

This commit is contained in:
schlagmichdoch 2022-12-31 12:14:56 +01:00
parent 651047cfa8
commit 0436a2185a
2 changed files with 7 additions and 3 deletions

View file

@ -390,7 +390,7 @@ class PeersManager {
Events.on('files-selected', e => this._onFilesSelected(e.detail));
Events.on('send-text', e => this._onSendText(e.detail));
Events.on('peer-left', e => this._onPeerLeft(e.detail));
Events.on('disconnect', this._clearPeers);
Events.on('disconnect', _ => this._clearPeers());
}
_onMessage(message) {

View file

@ -659,8 +659,12 @@ Events.on('load', () => {
}
}
window.animateBackground = function(l) {
loading = l;
animate();
if (!l) {
loading = false;
} else if (!loading) {
loading = true;
animate();
}
};
init();
animate();