diff --git a/src/App.jsx b/src/App.jsx index c7d0edad..f45cd39f 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -6,6 +6,7 @@ import Modals from 'features/misc/modals/Modals'; import { loadSettings, moveSettings } from 'utils/settings'; import EventBus from 'utils/eventbus'; import variables from 'config/variables'; +import Preview from 'features/helpers/preview/Preview'; import Welcome from 'features/welcome/Welcome'; @@ -56,12 +57,8 @@ const App = () => { useAppSetup(); - if (localStorage.getItem('showWelcome')) { - return ( - <> - - > - ); + if (localStorage.getItem('showWelcome') === 'true') { + return ; } return ( @@ -78,6 +75,9 @@ const App = () => { + {localStorage.getItem('welcomePreview') === 'true' && ( + window.location.reload()} /> + )} > ); }; diff --git a/src/features/helpers/preview/Preview.jsx b/src/features/helpers/preview/Preview.jsx index 75672751..b73826ab 100644 --- a/src/features/helpers/preview/Preview.jsx +++ b/src/features/helpers/preview/Preview.jsx @@ -3,11 +3,17 @@ import variables from 'config/variables'; import './preview.scss'; function Preview(props) { + const setup = () => { + localStorage.setItem('showWelcome', true); + localStorage.setItem('welcomePreview', false); + window.location.reload(); + }; + return ( {variables.getMessage('modals.main.settings.reminder.title')} {variables.getMessage('modals.welcome.preview.description')} - props.setup()}> + setup()}> {variables.getMessage('modals.welcome.preview.continue')} diff --git a/src/features/misc/modals/Modals.jsx b/src/features/misc/modals/Modals.jsx index 0a0283a6..91036b46 100644 --- a/src/features/misc/modals/Modals.jsx +++ b/src/features/misc/modals/Modals.jsx @@ -102,8 +102,8 @@ export default class Modals extends PureComponent { ariaHideApp={false} > this.closeWelcome()} modalSkip={() => this.previewWelcome()} /> - */} - {this.state.preview && window.location.reload()} />} + + {this.state.preview && window.location.reload()} />}*/} > ); } diff --git a/src/features/welcome/Welcome.jsx b/src/features/welcome/Welcome.jsx index b9ce50a0..b5219644 100644 --- a/src/features/welcome/Welcome.jsx +++ b/src/features/welcome/Welcome.jsx @@ -102,6 +102,14 @@ function WelcomeModal() { updateTabAndButtonText(tab); }; + const modalSkip = () => { + localStorage.setItem('showWelcome', false); + localStorage.setItem('welcomePreview', true); + window.location.reload(); + }; + + console.log(localStorage.getItem('showWelcome')); + const Navigation = () => { return ( @@ -115,7 +123,7 @@ function WelcomeModal() { ) : ( modalSkip()} + onClick={() => modalSkip()} icon={} label={variables.getMessage('modals.welcome.buttons.preview')} /> @@ -216,7 +224,7 @@ function WelcomeModal() { initial="enter" animate="center" exit="exit" - transition={{ type: 'tween', duration: 1 }} + transition={{ type: 'tween', duration: 0.8 }} style={{ position: 'absolute', height: '100%' }} > {tabs[currentTab]}