From ba09b7d8a857128b33d82394ff0c324c40a3ac52 Mon Sep 17 00:00:00 2001 From: RemixDev Date: Sun, 31 May 2020 12:27:33 +0200 Subject: [PATCH] Update user favorites only if user is logged in --- server.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/server.py b/server.py index c5958e3..92924f6 100644 --- a/server.py +++ b/server.py @@ -121,11 +121,12 @@ def login(arl, force=False, child=0): else: result = 2 emit('logged_in', {'status': result, 'arl': arl, 'user': session['dz'].user}) - emit('familyAccounts', session['dz'].childs) - emit('init_favorites', app.getUserFavorites(session['dz'])) if firstConnection and result in [1, 3]: firstConnection = False app.loadDownloadQueue(session['dz'], socket_interface) + if result != 0: + emit('familyAccounts', session['dz'].childs) + emit('init_favorites', app.getUserFavorites(session['dz'])) @socketio.on('changeAccount')