Skip to content

Commit

Permalink
Prevent threebox notification from showing if feature flag is falsy
Browse files Browse the repository at this point in the history
  • Loading branch information
danjm committed Sep 12, 2019
1 parent a203d58 commit 4fcc18a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ui/app/pages/home/home.component.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export default class Home extends PureComponent {
restoreFromThreeBox: PropTypes.func,
setRestoredFromThreeBoxToFalse: PropTypes.func,
threeBoxLastUpdated: PropTypes.string,
threeBoxFeatureFlagIsTrue: PropTypes.bool,
}

componentWillMount () {
Expand Down Expand Up @@ -96,6 +97,7 @@ export default class Home extends PureComponent {
setRestoredFromThreeBoxToFalse,
restoredFromThreeBox,
threeBoxLastUpdated,
threeBoxFeatureFlagIsTrue,
} = this.props

if (forgottenPassword) {
Expand Down Expand Up @@ -153,7 +155,7 @@ export default class Home extends PureComponent {
/>,
},
{
shouldBeRendered: threeBoxLastUpdated && restoredFromThreeBox === null,
shouldBeRendered: threeBoxFeatureFlagIsTrue && threeBoxLastUpdated && restoredFromThreeBox === null,
component: <HomeNotification
descriptionText={t('restoreWalletPreferences', [ formatDate(parseInt(threeBoxLastUpdated), 'M/d/y') ])}
acceptText={t('restore')}
Expand Down
2 changes: 2 additions & 0 deletions ui/app/pages/home/home.container.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ const mapStateToProps = state => {
threeBoxSynced,
restoredFromThreeBox,
selectedAddress,
featureFlags,
} = metamask
const accountBalance = getCurrentEthBalance(state)
const { forgottenPassword, threeBoxLastUpdated } = appState
Expand All @@ -44,6 +45,7 @@ const mapStateToProps = state => {
restoredFromThreeBox,
selectedAddress,
threeBoxLastUpdated,
threeBoxFeatureFlagIsTrue: featureFlags.threeBox,
}
}

Expand Down

0 comments on commit 4fcc18a

Please sign in to comment.