1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 19:26:13 +02:00

Display seed phrase reminder if user has tokens (#6952)

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.
This commit is contained in:
Mark Stacey 2019-08-02 16:13:15 -02:30 committed by GitHub
parent 6a0dbcdb31
commit 2649b9b8bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -23,6 +23,7 @@ const mapStateToProps = state => {
privacyMode,
} = {},
seedPhraseBackedUp,
tokens,
} = metamask
const accountBalance = getCurrentEthBalance(state)
const { forgottenPassword } = appState
@ -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),
}
}