From 45faee508d6f29432b7d420e1a4bc6db58571f08 Mon Sep 17 00:00:00 2001 From: Josh Leonard <30185185+josheleonard@users.noreply.github.com> Date: Wed, 21 Feb 2024 20:33:31 +0000 Subject: [PATCH] fix: hide rewards account if using Solana self-custody (#22227) --- .../brave_wallet_ui/common/async/base-query-cache.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/components/brave_wallet_ui/common/async/base-query-cache.ts b/components/brave_wallet_ui/common/async/base-query-cache.ts index 0344716c07b..6227c2bdcd6 100644 --- a/components/brave_wallet_ui/common/async/base-query-cache.ts +++ b/components/brave_wallet_ui/common/async/base-query-cache.ts @@ -369,12 +369,15 @@ export class BaseQueryCache { this.rewardsInfo = emptyRewardsInfo return this.rewardsInfo } - - const balance = await getBraveRewardsProxy().fetchBalance() - const { provider, status, links } = (await getBraveRewardsProxy().getExternalWallet()) || {} + if (!provider || provider === 'solana') { + return emptyRewardsInfo + } + + const balance = await getBraveRewardsProxy().fetchBalance() + this.rewardsInfo = { isRewardsEnabled: true, balance,