diff --git a/test/e2e/fixtures/special-settings/state.json b/test/e2e/fixtures/special-settings/state.json index b1bdad525..f4fa15647 100644 --- a/test/e2e/fixtures/special-settings/state.json +++ b/test/e2e/fixtures/special-settings/state.json @@ -53,6 +53,12 @@ "8": { "isShown": true }, + "10": { + "isShown": true + }, + "11": { + "isShown": true + }, "12": { "isShown": true }, diff --git a/ui/ducks/app/app.js b/ui/ducks/app/app.js index 186af52f0..78fb56fb6 100644 --- a/ui/ducks/app/app.js +++ b/ui/ducks/app/app.js @@ -62,6 +62,7 @@ export default function reduceApp(state = {}, action) { sendInputCurrencySwitched: false, newTokensImported: '', newCustomNetworkAdded: {}, + onboardedInThisUISession: false, ...state, }; @@ -406,6 +407,11 @@ export default function reduceApp(state = {}, action) { ...appState, newCustomNetworkAdded: action.value, }; + case actionConstants.ONBOARDED_IN_THIS_UI_SESSION: + return { + ...appState, + onboardedInThisUISession: action.value, + }; default: return appState; } @@ -471,3 +477,7 @@ export function toggleCurrencySwitch() { export function setNewCustomNetworkAdded(value) { return { type: actionConstants.SET_NEW_CUSTOM_NETWORK_ADDED, value }; } + +export function setOnBoardedInThisUISession(value) { + return { type: actionConstants.ONBOARDED_IN_THIS_UI_SESSION, value }; +} diff --git a/ui/pages/first-time-flow/end-of-flow/end-of-flow.component.js b/ui/pages/first-time-flow/end-of-flow/end-of-flow.component.js index 1b3938fc7..8fb2dabd5 100644 --- a/ui/pages/first-time-flow/end-of-flow/end-of-flow.component.js +++ b/ui/pages/first-time-flow/end-of-flow/end-of-flow.component.js @@ -17,6 +17,7 @@ export default class EndOfFlowScreen extends PureComponent { static contextTypes = { t: PropTypes.func, trackEvent: PropTypes.func, + setOnBoardedInThisUISession: PropTypes.func, }; static propTypes = { @@ -26,6 +27,7 @@ export default class EndOfFlowScreen extends PureComponent { location: PropTypes.string, tabId: PropTypes.number, }), + setOnBoardedInThisUISession: PropTypes.func, }; async _beforeUnload() { @@ -37,7 +39,8 @@ export default class EndOfFlowScreen extends PureComponent { } async _onOnboardingComplete() { - const { setCompletedOnboarding } = this.props; + const { setCompletedOnboarding, setOnBoardedInThisUISession } = this.props; + setOnBoardedInThisUISession(true); await setCompletedOnboarding(); } diff --git a/ui/pages/first-time-flow/end-of-flow/end-of-flow.container.js b/ui/pages/first-time-flow/end-of-flow/end-of-flow.container.js index 6df628ee9..0e8b8db0e 100644 --- a/ui/pages/first-time-flow/end-of-flow/end-of-flow.container.js +++ b/ui/pages/first-time-flow/end-of-flow/end-of-flow.container.js @@ -2,6 +2,7 @@ import { connect } from 'react-redux'; import { getOnboardingInitiator } from '../../../selectors'; import { setCompletedOnboarding } from '../../../store/actions'; +import { setOnBoardedInThisUISession } from '../../../ducks/app/app'; import EndOfFlow from './end-of-flow.component'; const mapStateToProps = (state) => { @@ -13,6 +14,8 @@ const mapStateToProps = (state) => { const mapDispatchToProps = (dispatch) => { return { setCompletedOnboarding: () => dispatch(setCompletedOnboarding()), + setOnBoardedInThisUISession: (value) => + dispatch(setOnBoardedInThisUISession(value)), }; }; diff --git a/ui/pages/first-time-flow/end-of-flow/end-of-flow.test.js b/ui/pages/first-time-flow/end-of-flow/end-of-flow.test.js index 4f645e149..c862704f7 100644 --- a/ui/pages/first-time-flow/end-of-flow/end-of-flow.test.js +++ b/ui/pages/first-time-flow/end-of-flow/end-of-flow.test.js @@ -12,6 +12,7 @@ describe('End of Flow Screen', () => { push: sinon.stub(), }, setCompletedOnboarding: sinon.stub().resolves(), + setOnBoardedInThisUISession: sinon.stub(), }; beforeEach(() => { diff --git a/ui/pages/home/home.component.js b/ui/pages/home/home.component.js index 935f01ff6..8318ddd25 100644 --- a/ui/pages/home/home.component.js +++ b/ui/pages/home/home.component.js @@ -153,6 +153,7 @@ export default class Home extends PureComponent { newCustomNetworkAdded: PropTypes.object, clearNewCustomNetworkAdded: PropTypes.func, setRpcTarget: PropTypes.func, + onboardedInThisUISession: PropTypes.bool, }; state = { @@ -613,6 +614,7 @@ export default class Home extends PureComponent { firstTimeFlowType, completedOnboarding, shouldShowSeedPhraseReminder, + onboardedInThisUISession, } = this.props; if (forgottenPassword) { @@ -622,8 +624,8 @@ export default class Home extends PureComponent { } const showWhatsNew = - ((completedOnboarding && firstTimeFlowType === 'import') || - !completedOnboarding) && + completedOnboarding && + (!onboardedInThisUISession || firstTimeFlowType === 'import') && announcementsToShow && showWhatsNewPopup && !showPortfolioTooltip && diff --git a/ui/pages/home/home.container.js b/ui/pages/home/home.container.js index 1417ec97a..11d27407f 100644 --- a/ui/pages/home/home.container.js +++ b/ui/pages/home/home.container.js @@ -157,6 +157,7 @@ const mapStateToProps = (state) => { newCollectibleAddedMessage: getNewCollectibleAddedMessage(state), newTokensImported: getNewTokensImported(state), newCustomNetworkAdded: appState.newCustomNetworkAdded, + onboardedInThisUISession: appState.onboardedInThisUISession, }; }; diff --git a/ui/store/actionConstants.js b/ui/store/actionConstants.js index 6d7bb77cf..f9878968e 100644 --- a/ui/store/actionConstants.js +++ b/ui/store/actionConstants.js @@ -74,6 +74,7 @@ export const UPDATE_PREFERENCES = 'UPDATE_PREFERENCES'; // Onboarding export const COMPLETE_ONBOARDING = 'COMPLETE_ONBOARDING'; +export const ONBOARDED_IN_THIS_UI_SESSION = 'ONBOARDED_IN_THIS_UI_SESSION'; export const SET_MOUSE_USER_STATE = 'SET_MOUSE_USER_STATE';