From 8aa36068a0db324508a19779791fcd1ec4a1a2e8 Mon Sep 17 00:00:00 2001 From: Sale Djenic Date: Fri, 2 Dec 2022 11:24:59 +0100 Subject: [PATCH] fix(@desktop/keycard): modal title edits and migrate flow - 01: Keycard settings menu labelling - fixed in this commit - 02: Modal title renaming - not developed yet - 03: Additional decision diamond and flow - not developed yet - 04: Modal title renaming - not developed yet - 05: Modal title renaming - done in issue #7035 - 06: Copy change - fixed in this commit Fixes: #8458 --- .../keycard_popup/models/key_pair_selected_item.nim | 8 ++++++++ src/app/modules/shared_modules/keycard_popup/module.nim | 1 + ui/app/AppLayouts/Profile/views/keycard/MainView.qml | 2 +- .../shared/popups/keycard/states/KeycardConfirmation.qml | 8 ++++++-- 4 files changed, 16 insertions(+), 3 deletions(-) diff --git a/src/app/modules/shared_modules/keycard_popup/models/key_pair_selected_item.nim b/src/app/modules/shared_modules/keycard_popup/models/key_pair_selected_item.nim index fac97c56ff..b079e1ff6e 100644 --- a/src/app/modules/shared_modules/keycard_popup/models/key_pair_selected_item.nim +++ b/src/app/modules/shared_modules/keycard_popup/models/key_pair_selected_item.nim @@ -34,6 +34,14 @@ QtObject: self.keyPairSelectedItemLockedChanged() self.keyPairSelectedItemIconChanged() + proc getKeyUid*(self: KeyPairSelectedItem): string {.slot.} = + if(self.item.isNil): + return "" + return self.item.keyUid() + QtProperty[string] keyUid: + read = getKeyUid + notify = keyPairSelectedItemChanged + proc getPubKey*(self: KeyPairSelectedItem): string {.slot.} = if(self.item.isNil): return "" diff --git a/src/app/modules/shared_modules/keycard_popup/module.nim b/src/app/modules/shared_modules/keycard_popup/module.nim index e9b21bf0ee..d9e1f99e2e 100644 --- a/src/app/modules/shared_modules/keycard_popup/module.nim +++ b/src/app/modules/shared_modules/keycard_popup/module.nim @@ -468,6 +468,7 @@ proc updateKeyPairItemIfDataAreKnown[T](self: Module[T], address: string, item: var icon = "" if a.walletType == WalletTypeDefaultStatusAccount: icon = "wallet" + item.setKeyUid(a.keyUid) item.addAccount(a.name, a.path, a.address, a.emoji, a.color, icon, balance = 0.0) return true return false diff --git a/ui/app/AppLayouts/Profile/views/keycard/MainView.qml b/ui/app/AppLayouts/Profile/views/keycard/MainView.qml index cda4bd2192..f9a1551bb2 100644 --- a/ui/app/AppLayouts/Profile/views/keycard/MainView.qml +++ b/ui/app/AppLayouts/Profile/views/keycard/MainView.qml @@ -117,7 +117,7 @@ ColumnLayout { StatusListItem { Layout.fillWidth: true - title: qsTr("Generate a seed phrase") + title: qsTr("Generate a new seed phrase") components: [ StatusIcon { icon: "tiny/chevron-right" diff --git a/ui/imports/shared/popups/keycard/states/KeycardConfirmation.qml b/ui/imports/shared/popups/keycard/states/KeycardConfirmation.qml index 0e58815fe9..bcce0cbc6c 100644 --- a/ui/imports/shared/popups/keycard/states/KeycardConfirmation.qml +++ b/ui/imports/shared/popups/keycard/states/KeycardConfirmation.qml @@ -70,8 +70,12 @@ Item { Layout.alignment: Qt.AlignHCenter horizontalAlignment: Text.AlignHCenter Layout.preferredHeight: Constants.keycard.general.titleHeight - wrapMode: Text.WordWrap - text: qsTr("A factory reset will delete the key on this Keycard.\nAre you sure you want to do this?") + text: { + if (root.sharedKeycardModule.keyPairStoredOnKeycard.keyUid === userProfile.keyUid) + return qsTr("Warning, this Keycard stores your main Status profile and\naccounts. A factory reset will permanently delete it.") + + return qsTr("A factory reset will delete the key on this Keycard.\nAre you sure you want to do this?") + } font.pixelSize: Constants.keycard.general.fontSize2 color: Theme.palette.dangerColor1 }