fix(wallet): Disable adding new watch-only accounts

closes: #15933
This commit is contained in:
belalshehab 2024-08-01 03:35:19 +03:00 committed by Belal Shehab
parent 2cd6de11c9
commit b8bc0a9631
1 changed files with 17 additions and 1 deletions

View File

@ -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