Skip to content

Commit

Permalink
Merge pull request #6983 from brave/connected-publisher
Browse files Browse the repository at this point in the history
Fixes verified message on tipping banner
  • Loading branch information
NejcZdovc authored Oct 30, 2020
2 parents 71667f1 + 42ff670 commit 879d358
Showing 1 changed file with 16 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -167,15 +167,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 (
Expand Down

0 comments on commit 879d358

Please sign in to comment.