From 124602d2ad0a5cb2f991f0aa65fc3eef5a24dc20 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 31 Mar 2022 14:19:41 +0200 Subject: [PATCH] Return account widget to it's former glory --- cura/API/Account.py | 4 ++-- resources/qml/Account/AccountWidget.qml | 2 +- resources/qml/MainWindow/MainWindowHeader.qml | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cura/API/Account.py b/cura/API/Account.py index 993e53e539..b63983e0cc 100644 --- a/cura/API/Account.py +++ b/cura/API/Account.py @@ -269,10 +269,10 @@ class Account(QObject): return self._authorization_service.getAccessToken() @pyqtProperty("QVariantMap", notify = userProfileChanged) - def userProfile(self) -> Optional[Dict[str, Optional[str]]]: + def userProfile(self) -> Dict[str, Optional[str]]: """None if no user is logged in otherwise the logged in user as a dict containing containing user_id, username and profile_image_url """ if not self._user_profile: - return None + return {} return self._user_profile.__dict__ @pyqtProperty(str, notify=lastSyncDateTimeChanged) diff --git a/resources/qml/Account/AccountWidget.qml b/resources/qml/Account/AccountWidget.qml index d738c5c474..cf681477d4 100644 --- a/resources/qml/Account/AccountWidget.qml +++ b/resources/qml/Account/AccountWidget.qml @@ -10,7 +10,7 @@ import Cura 1.1 as Cura Item { property var profile: Cura.API.account.userProfile - property var loggedIn: Cura.API.account.isLoggedIn + property bool loggedIn: Cura.API.account.isLoggedIn height: signInButton.visible ? signInButton.height : accountWidget.height width: signInButton.visible ? signInButton.width : accountWidget.width diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index 6e477913e1..3f22879992 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -203,7 +203,7 @@ Item } } - /*AccountWidget + AccountWidget { id: accountWidget anchors @@ -212,5 +212,5 @@ Item right: parent.right rightMargin: UM.Theme.getSize("default_margin").width } - }*/ + } }