From 3ff97c9137eaa2857e887520b33b173e8f9bce5c Mon Sep 17 00:00:00 2001 From: Igor Sirotin Date: Tue, 2 May 2023 16:37:31 +0300 Subject: [PATCH] fix(Onboarding): Image is visible after first onboard. Other minor fixes (#10489) --- src/app/modules/startup/module.nim | 5 +++-- .../Onboarding/views/InsertDetailsView.qml | 13 +------------ ui/app/AppLayouts/Profile/stores/ProfileStore.qml | 4 ++-- ui/imports/utils/Utils.qml | 4 +++- 4 files changed, 9 insertions(+), 17 deletions(-) diff --git a/src/app/modules/startup/module.nim b/src/app/modules/startup/module.nim index eef54430fc..ad4841201b 100644 --- a/src/app/modules/startup/module.nim +++ b/src/app/modules/startup/module.nim @@ -407,7 +407,8 @@ method onNodeLogin*[T](self: Module[T], error: string) = self.logoutAndDisplayError(err, StartupErrorType.UnknownType) return if currStateObj.flowType() != FlowType.AppLogin: - discard self.controller.storeIdentityImage() + let images = self.controller.storeIdentityImage() + self.accountsService.updateLoggedInAccount(self.getDisplayName, images) self.delegate.finishAppLoading() else: self.moveToStartupState() @@ -514,4 +515,4 @@ method onLocalPairingStatusUpdate*[T](self: Module[T], status: LocalPairingStatu self.view.onLocalPairingStatusUpdate(status) method onReencryptionProcessStarted*[T](self: Module[T]) = - self.view.onReencryptionProcessStarted() \ No newline at end of file + self.view.onReencryptionProcessStarted() diff --git a/ui/app/AppLayouts/Onboarding/views/InsertDetailsView.qml b/ui/app/AppLayouts/Onboarding/views/InsertDetailsView.qml index 0651eea411..0517e0210a 100644 --- a/ui/app/AppLayouts/Onboarding/views/InsertDetailsView.qml +++ b/ui/app/AppLayouts/Onboarding/views/InsertDetailsView.qml @@ -148,18 +148,7 @@ Item { input.edit.objectName: "onboardingDisplayNameInput" width: parent.width placeholderText: qsTr("Display name") - input.rightComponent: RoundedIcon { - width: 14 - height: 14 - iconWidth: 14 - iconHeight: 14 - visible: (nameInput.input.text.length > 0) - color: "transparent" - source: Style.svg("close-filled") - onClicked: { - nameInput.input.edit.clear(); - } - } + input.clearable: true errorMessageCmp.wrapMode: Text.NoWrap errorMessageCmp.horizontalAlignment: Text.AlignHCenter validators: Constants.validators.displayName diff --git a/ui/app/AppLayouts/Profile/stores/ProfileStore.qml b/ui/app/AppLayouts/Profile/stores/ProfileStore.qml index 2463d6698b..04897bc19b 100644 --- a/ui/app/AppLayouts/Profile/stores/ProfileStore.qml +++ b/ui/app/AppLayouts/Profile/stores/ProfileStore.qml @@ -15,8 +15,8 @@ QtObject { property string icon: !!Global.userProfile? Global.userProfile.icon : "" property bool userDeclinedBackupBanner: Global.appIsReady? localAccountSensitiveSettings.userDeclinedBackupBanner : false property var privacyStore: profileSectionModule.privacyModule - readonly property string keyUid: userProfile.keyUid - readonly property bool isKeycardUser: userProfile.isKeycardUser + readonly property string keyUid: !!Global.userProfile ? Global.userProfile.keyUid : "" + readonly property bool isKeycardUser: !!Global.userProfile ? Global.userProfile.isKeycardUser : false readonly property string bio: profileModule.bio readonly property string socialLinksJson: profileModule.socialLinksJson diff --git a/ui/imports/utils/Utils.qml b/ui/imports/utils/Utils.qml index 7cd8d0ab4c..259ced48d3 100644 --- a/ui/imports/utils/Utils.qml +++ b/ui/imports/utils/Utils.qml @@ -435,7 +435,9 @@ QtObject { function isEnsVerified(publicKey) { if (publicKey === "" || !isChatKey(publicKey) ) - return + return false + if (!mainModuleInst) + return false return mainModuleInst.isEnsVerified(publicKey) }