From bf910fb17c7ed2b49a19f578b4e47e38b6429c46 Mon Sep 17 00:00:00 2001 From: brave-builds Date: Fri, 30 Oct 2020 06:59:35 +0000 Subject: [PATCH] Uplift of #6983 (squashed) to beta --- .../tip/components/publisher_banner.tsx | 23 +++++++++++++------ 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/components/brave_rewards/resources/tip/components/publisher_banner.tsx b/components/brave_rewards/resources/tip/components/publisher_banner.tsx index 4de3b0d59e3b..d49375e89dfa 100644 --- a/components/brave_rewards/resources/tip/components/publisher_banner.tsx +++ b/components/brave_rewards/resources/tip/components/publisher_banner.tsx @@ -154,15 +154,24 @@ function showUnverifiedNotice ( case PublisherStatus.VERIFIED: return false } - const hasNonUserFunds = Boolean(balanceInfo && ( - balanceInfo.wallets['anonymous'] || - balanceInfo.wallets['blinded'])) + if (!externalWalletInfo) { + return false + } + + const status = externalWalletInfo.status + const connected = publisherInfo.status === PublisherStatus.CONNECTED - const walletConnectedOrVerified = Boolean(externalWalletInfo && ( - externalWalletInfo.status === ExternalWalletStatus.CONNECTED || - externalWalletInfo.status === ExternalWalletStatus.VERIFIED)) + if (connected && ( + status === ExternalWalletStatus.DISCONNECTED_NOT_VERIFIED || + status === ExternalWalletStatus.DISCONNECTED_VERIFIED)) { + return false + } + + const hasNonUserFunds = Boolean(balanceInfo && ( + !balanceInfo.wallets['anonymous'] && + !balanceInfo.wallets['blinded'])) - return hasNonUserFunds && walletConnectedOrVerified + return connected && hasNonUserFunds } function getUnverifiedNotice (