Skip to content

Commit

Permalink
Display seed phrase reminder if user has tokens (#6952)
Browse files Browse the repository at this point in the history
The seed phrase reminder will now be triggered if the user has eth *OR*
if the user has added a token. This is to ensure that a user can't have
a positive token balance without being reminded to backup the account.

Checking for the token in preferences was easier than checking the
actual token balance, because the token balance is not yet in Redux.
That would require a more substantial refactor.
  • Loading branch information
Gudahtt authored Aug 2, 2019
1 parent 6a0dbcd commit 2649b9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ui/app/pages/home/home.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const mapStateToProps = state => {
privacyMode,
} = {},
seedPhraseBackedUp,
tokens,
} = metamask
const accountBalance = getCurrentEthBalance(state)
const { forgottenPassword } = appState
Expand All @@ -39,7 +40,7 @@ const mapStateToProps = state => {
showPrivacyModeNotification: migratedPrivacyMode,
activeTab,
viewingUnconnectedDapp: isUnconnected && isPopup,
shouldShowSeedPhraseReminder: parseInt(accountBalance, 16) > 0 && !seedPhraseBackedUp,
shouldShowSeedPhraseReminder: !seedPhraseBackedUp && (parseInt(accountBalance, 16) > 0 || tokens.length > 0),
}
}

Expand Down

0 comments on commit 2649b9b

Please sign in to comment.