From b8bc0a96312e24dc7481d510a233c348ebca2517 Mon Sep 17 00:00:00 2001 From: belalshehab Date: Thu, 1 Aug 2024 03:35:19 +0300 Subject: [PATCH] fix(wallet): Disable adding new watch-only accounts closes: #15933 --- .../shared/popups/addaccount/states/Main.qml | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/ui/imports/shared/popups/addaccount/states/Main.qml b/ui/imports/shared/popups/addaccount/states/Main.qml index 6da5bfba31..c736db2990 100644 --- a/ui/imports/shared/popups/addaccount/states/Main.qml +++ b/ui/imports/shared/popups/addaccount/states/Main.qml @@ -9,6 +9,8 @@ import StatusQ.Controls 0.1 import StatusQ.Controls.Validators 0.1 import utils 1.0 +import StatusQ 0.1 +import SortFilterProxyModel 0.2 import "../stores" import "../panels" @@ -49,6 +51,20 @@ Item { id: d readonly property bool isEdit: root.store.editMode + readonly property SortFilterProxyModel originModelWithoutWatchOnlyAcc: SortFilterProxyModel { + id: originModelWithoutWatchOnlyAcc + objectName: "originModelWithoutWatchOnlyAcc" + sourceModel: root.store.originModel + + readonly property string addWatchOnlyAccKeyUid: Constants.appTranslatableConstants.addAccountLabelOptionAddWatchOnlyAcc + filters: [ + FastExpressionFilter { + expression: model.keyPair.keyUid !== originModelWithoutWatchOnlyAcc.addWatchOnlyAccKeyUid + expectedRoles: ["keyPair"] + } + ] + } + function openEmojiPopup(showLeft) { if (!root.store.emojiPopup) { return @@ -171,7 +187,7 @@ Item { anchors.horizontalCenter: parent.horizontalCenter userProfilePublicKey: root.store.userProfilePublicKey - originModel: root.store.editMode? [] : root.store.originModel + originModel: root.store.editMode? [] : d.originModelWithoutWatchOnlyAcc selectedOrigin: root.store.selectedOrigin caretVisible: !root.store.editMode enabled: !root.store.editMode