From 39d533acd45a428623a94589ce39986a519a92e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Cie=C5=9Blak?= Date: Thu, 1 Aug 2024 12:17:36 +0200 Subject: [PATCH] fix(Wallet/SendModal): Using community assets in SendModal unblocked Closes: #15766 --- ui/app/AppLayouts/Profile/views/wallet/ManageTokensView.qml | 4 ++++ ui/app/AppLayouts/Wallet/WalletLayout.qml | 3 ++- ui/app/AppLayouts/Wallet/controls/TokenSelectorNew.qml | 3 +-- ui/app/AppLayouts/Wallet/panels/TokenSelectorPanel.qml | 2 -- ui/app/AppLayouts/Wallet/stores/TokensStore.qml | 4 +++- ui/app/AppLayouts/Wallet/views/RightTabView.qml | 3 +-- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ui/app/AppLayouts/Profile/views/wallet/ManageTokensView.qml b/ui/app/AppLayouts/Profile/views/wallet/ManageTokensView.qml index a6a1a00288..3173e03b41 100644 --- a/ui/app/AppLayouts/Profile/views/wallet/ManageTokensView.qml +++ b/ui/app/AppLayouts/Profile/views/wallet/ManageTokensView.qml @@ -178,6 +178,9 @@ Item { spacing: 8 StatusListItem { + // Temporarily disabled, refer to https://github.com/status-im/status-desktop/issues/15955 for details. + visible: false + Layout.fillWidth: true title: qsTr("Show community assets when sending tokens") @@ -199,6 +202,7 @@ Item { } } StatusDialogDivider { + visible: false Layout.fillWidth: true } StatusListItem { diff --git a/ui/app/AppLayouts/Wallet/WalletLayout.qml b/ui/app/AppLayouts/Wallet/WalletLayout.qml index 71338702ff..42bcf4f36f 100644 --- a/ui/app/AppLayouts/Wallet/WalletLayout.qml +++ b/ui/app/AppLayouts/Wallet/WalletLayout.qml @@ -318,10 +318,11 @@ Item { root.sendModalPopup) return } + // Common send modal popup: root.sendModalPopup.preSelectedAccountAddress = fromAddress root.sendModalPopup.preSelectedSendType = Constants.SendType.Transfer - root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingID + root.sendModalPopup.preSelectedHoldingID = walletStore.currentViewedHoldingTokensKey root.sendModalPopup.preSelectedHoldingType = walletStore.currentViewedHoldingType root.sendModalPopup.onlyAssets = false root.sendModalPopup.open() diff --git a/ui/app/AppLayouts/Wallet/controls/TokenSelectorNew.qml b/ui/app/AppLayouts/Wallet/controls/TokenSelectorNew.qml index 01c1d9888e..845d06acfe 100644 --- a/ui/app/AppLayouts/Wallet/controls/TokenSelectorNew.qml +++ b/ui/app/AppLayouts/Wallet/controls/TokenSelectorNew.qml @@ -162,8 +162,7 @@ Control { const entry = ModelUtils.getByKey(assetsModel, "tokensKey", key) highlightedKey = key - setCurrentAndClose(entry.symbol, - Constants.tokenIcon(entry.symbol)) + setCurrentAndClose(entry.symbol, entry.iconSource) root.assetSelected(key) } diff --git a/ui/app/AppLayouts/Wallet/panels/TokenSelectorPanel.qml b/ui/app/AppLayouts/Wallet/panels/TokenSelectorPanel.qml index 579ea9e24f..571a702a9a 100644 --- a/ui/app/AppLayouts/Wallet/panels/TokenSelectorPanel.qml +++ b/ui/app/AppLayouts/Wallet/panels/TokenSelectorPanel.qml @@ -267,8 +267,6 @@ Control { section.property: "type" section.delegate: StatusBaseText { - id: sectionTitle - color: Theme.palette.baseColor1 topPadding: Style.current.padding diff --git a/ui/app/AppLayouts/Wallet/stores/TokensStore.qml b/ui/app/AppLayouts/Wallet/stores/TokensStore.qml index d3bebddbff..032f104318 100644 --- a/ui/app/AppLayouts/Wallet/stores/TokensStore.qml +++ b/ui/app/AppLayouts/Wallet/stores/TokensStore.qml @@ -108,7 +108,9 @@ QtObject { } // Property and methods below are used to apply advanced token management settings to the SendModal - readonly property bool showCommunityAssetsInSend: root._allTokensModule.showCommunityAssetWhenSendingTokens + + // Temporarily disabled, refer to https://github.com/status-im/status-desktop/issues/15955 for details. + readonly property bool showCommunityAssetsInSend: true //root._allTokensModule.showCommunityAssetWhenSendingTokens readonly property bool displayAssetsBelowBalance: root._allTokensModule.displayAssetsBelowBalance signal displayAssetsBelowBalanceThresholdChanged() diff --git a/ui/app/AppLayouts/Wallet/views/RightTabView.qml b/ui/app/AppLayouts/Wallet/views/RightTabView.qml index ee03eaa017..c2a3e93915 100644 --- a/ui/app/AppLayouts/Wallet/views/RightTabView.qml +++ b/ui/app/AppLayouts/Wallet/views/RightTabView.qml @@ -229,11 +229,10 @@ RightTabBaseView { swapVisible: Global.featureFlags.swapEnabled onSendRequested: { - const symbol = ModelUtils.getByKey(model, "key", key, "symbol") const modal = root.sendModal modal.preSelectedSendType = Constants.SendType.Transfer - modal.preSelectedHoldingID = symbol + modal.preSelectedHoldingID = key modal.preSelectedHoldingType = Constants.TokenType.ERC20 modal.onlyAssets = true modal.open()