Skip to content

Commit

Permalink
Added flag hasSeenInformModal in local storage. (#935)
Browse files Browse the repository at this point in the history
Co-authored-by: Dmitry <[email protected]>
  • Loading branch information
AntonovDm and Dmitry committed May 20, 2024
1 parent 9c96fbe commit eb022eb
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 eb022eb

Please sign in to comment.