mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-16 07:55:55 +08:00
Connect signals before loading auth data
CURA-5744
This commit is contained in:
parent
47c5dbaf84
commit
f8369703ed
@ -42,15 +42,14 @@ class Account(QObject):
|
|||||||
AUTH_SUCCESS_REDIRECT="{}/app/auth-success".format(self._oauth_root),
|
AUTH_SUCCESS_REDIRECT="{}/app/auth-success".format(self._oauth_root),
|
||||||
AUTH_FAILED_REDIRECT="{}/app/auth-error".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._error_message = None # type: Optional[Message]
|
||||||
self._logged_in = False
|
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)
|
@pyqtProperty(bool, notify=loginStateChanged)
|
||||||
def isLoggedIn(self) -> bool:
|
def isLoggedIn(self) -> bool:
|
||||||
return self._logged_in
|
return self._logged_in
|
||||||
|
Loading…
x
Reference in New Issue
Block a user