From ad612a794ce5a99a2b1295a124156b7c0cb464d9 Mon Sep 17 00:00:00 2001 From: Jonathan Rainville Date: Thu, 11 Jul 2024 10:47:51 -0400 Subject: [PATCH] fix(sharedAddress): hide non fully imported accounts from shared address (#15480) * fix(sharedAddress): hide non fully imported accounts from shared address Fixes #15471 We only filtered out watch only accounts, but we also need to make sure it was a fully imported account, ie an account that is usable, hence why using `canSend`. It is the same property they use in the SendTransaction modal --- storybook/src/Models/WalletAccountsModel.qml | 5 +++++ ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml | 5 ++--- ui/app/AppLayouts/Wallet/stores/RootStore.qml | 5 ++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/storybook/src/Models/WalletAccountsModel.qml b/storybook/src/Models/WalletAccountsModel.qml index 4bab1476c2..623e5639ce 100644 --- a/storybook/src/Models/WalletAccountsModel.qml +++ b/storybook/src/Models/WalletAccountsModel.qml @@ -11,6 +11,7 @@ ListModel { color: "#2A4AF5", address: "0x7F47C2e18a4BBf5487E6fb082eC2D9Ab0E6d7240", walletType: "", + canSend: true, position: 0, assets: [ { @@ -55,6 +56,7 @@ ListModel { color: "#216266", address: "0x7F47C2e98a4BBf5487E6fb082eC2D9Ab0E6d8881", walletType: Constants.generatedWalletType, + canSend: true, position: 3, assets: [ { @@ -81,6 +83,7 @@ ListModel { color: "#EC266C", address: "0x7F47C2e98a4BBf5487E6fb082eC2D9Ab0E6d8882", walletType: Constants.seedWalletType, + canSend: true, position: 1, assets: [ { @@ -116,6 +119,7 @@ ListModel { color: "#CB6256", address: "0x7F47C2e98a4BBf5487E6fb082eC2D9Ab0E6d8883", walletType: Constants.watchWalletType, + canSend: false, position: 2, assets: [ ], @@ -133,6 +137,7 @@ ListModel { color: "#C78F67", address: "0x7F47C2e98a4BBf5487E6fb082eC2D9Ab0E6d8884", walletType: Constants.keyWalletType, + canSend: true, position: 4, assets: [ { diff --git a/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml b/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml index f2ab3c811d..ded8183c5c 100644 --- a/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml +++ b/ui/app/AppLayouts/Wallet/popups/swap/SwapModalAdaptor.qml @@ -38,9 +38,8 @@ QObject { readonly property var nonWatchAccounts: SortFilterProxyModel { sourceModel: root.swapStore.accounts filters: ValueFilter { - roleName: "walletType" - value: Constants.watchWalletType - inverted: true + roleName: "canSend" + value: true } sorters: [ RoleSorter { roleName: "currencyBalanceDouble"; sortOrder: Qt.DescendingOrder }, diff --git a/ui/app/AppLayouts/Wallet/stores/RootStore.qml b/ui/app/AppLayouts/Wallet/stores/RootStore.qml index ce8b57a929..d5e73a803a 100644 --- a/ui/app/AppLayouts/Wallet/stores/RootStore.qml +++ b/ui/app/AppLayouts/Wallet/stores/RootStore.qml @@ -80,9 +80,8 @@ QtObject { } ] filters: ValueFilter { - roleName: "walletType" - value: Constants.watchWalletType - inverted: true + roleName: "canSend" + value: true } }