From 2e68c97c8e3c847c3d0c998908662917fec74ce3 Mon Sep 17 00:00:00 2001 From: Khushboo Mehta Date: Fri, 7 Apr 2023 13:03:59 +0200 Subject: [PATCH] fix(@desktop/wallet): Wallet: user can click on dummy loading items from activity-history and open an empty transaction view fixes #10083 --- src/app/modules/main/wallet_section/accounts/model.nim | 2 +- src/app/modules/main/wallet_section/accounts/view.nim | 2 +- ui/imports/shared/controls/LoadingTokenDelegate.qml | 1 + ui/imports/shared/controls/TransactionDelegate.qml | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/modules/main/wallet_section/accounts/model.nim b/src/app/modules/main/wallet_section/accounts/model.nim index 72b52f942f..d20a8b71a7 100644 --- a/src/app/modules/main/wallet_section/accounts/model.nim +++ b/src/app/modules/main/wallet_section/accounts/model.nim @@ -152,7 +152,7 @@ QtObject: return newQVariant(account.getAssets()) return nil - proc getTokenBalanceOnChain1*(self: Model, address: string, chainId: int, tokenSymbol: string): CurrencyAmount = + proc getTokenBalanceOnChain*(self: Model, address: string, chainId: int, tokenSymbol: string): CurrencyAmount = for account in self.items: if(account.getAddress() == address): return account.getAssets().getTokenBalanceOnChain(chainId, tokenSymbol) diff --git a/src/app/modules/main/wallet_section/accounts/view.nim b/src/app/modules/main/wallet_section/accounts/view.nim index 8b56d94edd..18d6985194 100644 --- a/src/app/modules/main/wallet_section/accounts/view.nim +++ b/src/app/modules/main/wallet_section/accounts/view.nim @@ -187,7 +187,7 @@ QtObject: self.tmpSymbol = tokenSymbol proc getPreparedTokenBalanceOnChain*(self: View): QVariant {.slot.} = - let currencyAmount = self.model.getTokenBalanceOnChain1(self.tmpAddress, self.tmpChainId, self.tmpSymbol) + let currencyAmount = self.model.getTokenBalanceOnChain(self.tmpAddress, self.tmpChainId, self.tmpSymbol) self.tmpAddress = "" self.tmpChainId = 0 self.tmpSymbol = "ERROR" diff --git a/ui/imports/shared/controls/LoadingTokenDelegate.qml b/ui/imports/shared/controls/LoadingTokenDelegate.qml index 175f03e103..dfb545ca77 100644 --- a/ui/imports/shared/controls/LoadingTokenDelegate.qml +++ b/ui/imports/shared/controls/LoadingTokenDelegate.qml @@ -25,4 +25,5 @@ TokenDelegate { change24Hour.loading: true localeCurrencyBalance.loading: true textColor: Theme.palette.baseColor1 + enabled: false } diff --git a/ui/imports/shared/controls/TransactionDelegate.qml b/ui/imports/shared/controls/TransactionDelegate.qml index 23e28d78f5..53172690b4 100644 --- a/ui/imports/shared/controls/TransactionDelegate.qml +++ b/ui/imports/shared/controls/TransactionDelegate.qml @@ -64,6 +64,7 @@ StatusListItem { Utils.compactAddress(modelData.from, 4) : "" state: "normal" + enabled: !loading asset.isImage: !loading asset.name: root.image asset.isLetterIdenticon: loading