From f8369703ed4775c6e9ae2f5da3c32451f3c8b4a9 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 27 Sep 2018 13:45:46 +0200 Subject: [PATCH] Connect signals before loading auth data CURA-5744 --- cura/API/Account.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/cura/API/Account.py b/cura/API/Account.py index 18d9d5df03..3f328d71ef 100644 --- a/cura/API/Account.py +++ b/cura/API/Account.py @@ -42,15 +42,14 @@ class Account(QObject): AUTH_SUCCESS_REDIRECT="{}/app/auth-success".format(self._oauth_root), AUTH_FAILED_REDIRECT="{}/app/auth-error".format(self._oauth_root) ) - - self._authorization_service = AuthorizationService(Application.getInstance().getPreferences(), self._oauth_settings) - self._authorization_service.loadAuthDataFromPreferences() - self._authorization_service.onAuthStateChanged.connect(self._onLoginStateChanged) - self._authorization_service.onAuthenticationError.connect(self._onLoginStateChanged) - self._error_message = None # type: Optional[Message] self._logged_in = False + self._authorization_service = AuthorizationService(Application.getInstance().getPreferences(), self._oauth_settings) + self._authorization_service.onAuthStateChanged.connect(self._onLoginStateChanged) + self._authorization_service.onAuthenticationError.connect(self._onLoginStateChanged) + self._authorization_service.loadAuthDataFromPreferences() + @pyqtProperty(bool, notify=loginStateChanged) def isLoggedIn(self) -> bool: return self._logged_in