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

closes: #15933

Co-authored-by: belalshehab <belal@status.im>
This commit is contained in:
Belal Shehab 2024-08-02 20:41:05 +03:00 committed by GitHub
parent deff78ca86
commit 29a776114e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
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