diff --git a/frontend/src/component/InitialRedirect.tsx b/frontend/src/component/InitialRedirect.tsx index 5c0ebd201a..0589aad019 100644 --- a/frontend/src/component/InitialRedirect.tsx +++ b/frontend/src/component/InitialRedirect.tsx @@ -6,10 +6,12 @@ import Loader from './common/Loader/Loader'; import { useLocalStorageState } from 'hooks/useLocalStorageState'; import { useAuthUser } from 'hooks/api/getters/useAuth/useAuthUser'; +const defaultPage = '/personal'; + export const useLastViewedPage = (location?: Location) => { const [state, setState] = useLocalStorageState( 'lastViewedPage', - '/personal', + defaultPage, 7 * 24 * 60 * 60 * 1000, // 7 days, left to promote seeing Personal dashboard from time to time ); @@ -55,5 +57,9 @@ export const InitialRedirect = () => { return ; } - return ; + if (lastViewedPage && lastViewedPage !== '/') { + return ; + } + + return ; };