Skip to content

Commit

Permalink
Added flag hasSeenInformModal in local storage.
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmitry committed May 19, 2024
1 parent f7f9d54 commit b247cd3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/ApplicationRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { Navigate, Outlet, useRoutes } from 'react-router-dom';

import { version } from '../package.json';
import { NetworkDomManager } from './common/services/NetworkDomManager/NetworkDomManager';
import { localStorageManager } from './common/utils/localStorageManager.ts';
import { Layout } from './components/common/Layout/Layout';
import { PreSplashModal } from './components/PreSplashModal/PreSplashModal.tsx';
import { RouteConfigExtended } from './components/RouterTitle/RouteConfigExtended';
Expand Down Expand Up @@ -156,11 +157,16 @@ export const ApplicationRoutes: FC = () => {
}, []);

useEffect(() => {
const timer = setTimeout(() => {
openPreSplashModal();
}, 5000);
const hasSeenInformModal = localStorageManager.get('hasSeenInformModal');

return () => clearTimeout(timer);
if (!hasSeenInformModal) {
const timer = setTimeout(() => {
openPreSplashModal();
localStorageManager.set('hasSeenInformModal', true);
}, 5000);

return () => clearTimeout(timer);
}
}, []);

return (
Expand Down

0 comments on commit b247cd3

Please sign in to comment.