diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 8f73944d9..258982fe9 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -1959,6 +1959,9 @@ "ghostery_dawn_onboarding_toast_alert": { "message": "Error: " }, + "ghostery_dawn_onboarding_toast_logout": { + "message": "You are now signed out" + }, "enable_when_paused": { "message": "To use this function, Resume Ghostery." }, diff --git a/app/dawn-hub/Views/OnboardingViews/Step0_WelcomeView/WelcomeView.jsx b/app/dawn-hub/Views/OnboardingViews/Step0_WelcomeView/WelcomeView.jsx index 897a2a95b..b8f7a9a41 100644 --- a/app/dawn-hub/Views/OnboardingViews/Step0_WelcomeView/WelcomeView.jsx +++ b/app/dawn-hub/Views/OnboardingViews/Step0_WelcomeView/WelcomeView.jsx @@ -11,7 +11,7 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0 */ -import React from 'react'; +import React, { useEffect, useState } from 'react'; import PropTypes from 'prop-types'; import { NavLink } from 'react-router-dom'; import { ONBOARDING, WELCOME, SETUP_STARTED } from '../../OnboardingView/OnboardingConstants'; @@ -24,12 +24,36 @@ import { ONBOARDING, WELCOME, SETUP_STARTED } from '../../OnboardingView/Onboard const WelcomeView = (props) => { const { actions } = props; const { setSetupStep } = actions; + + const [getUserResolved, setGetUserResolved] = useState(false); + + const gateSetupStep = (e) => { + if (getUserResolved) { + setSetupStep({ + setup_step: WELCOME, + dawn_setup_number: SETUP_STARTED, + origin: ONBOARDING + }); + } else { + e.preventDefault(); + } + }; + + useEffect(() => { + actions.getUser(); + const timer = setTimeout(() => setGetUserResolved(true), 1000); + + return () => { + clearTimeout(timer); + }; + }, []); + return (
-