Skip to content

Commit

Permalink
update home page transition
Browse files Browse the repository at this point in the history
  • Loading branch information
a-type committed May 20, 2024
1 parent f6898d5 commit 46ec3ac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apps/shopping/web/src/pages/HomePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import { useEffect } from 'react';
export interface HomePageProps {}

export function HomePage({}: HomePageProps) {
const [lastList, setLastList] = useLocalStorage<string | null>(
'last-list',
null,
);
const [lastList] = useLocalStorage<string | null>('last-list', null);
const someList = hooks.useOneList();
const navigate = useNavigate();

useEffect(() => {
if (lastList || someList) {
navigate(`/list/${lastList || someList!.get('id')}`);
navigate(`/list/${lastList || someList!.get('id')}`, {
replace: true,
skipTransition: true,
});
}
}, [navigate, lastList, someList]);

Expand Down

0 comments on commit 46ec3ac

Please sign in to comment.