diff --git a/packages/web/components/elements/images/OmnivoreLogoBase.tsx b/packages/web/components/elements/images/OmnivoreLogoBase.tsx index ad827f9a8..605e7c632 100644 --- a/packages/web/components/elements/images/OmnivoreLogoBase.tsx +++ b/packages/web/components/elements/images/OmnivoreLogoBase.tsx @@ -21,10 +21,16 @@ export function OmnivoreLogoBase(props: OmnivoreLogoBaseProps): JSX.Element { alignItems: 'center', }} onClick={(event) => { + const navReturn = window.localStorage.getItem('nav-return') + if (navReturn) { + window.location.assign(navReturn) + return + } const query = window.sessionStorage.getItem('q') if (query) { - router.push(`/home?${query}`) - event.preventDefault() + window.location.assign(`/l/home?${query}`) + } else { + window.location.replace(`/l/home`) } }} tabIndex={-1} diff --git a/packages/web/components/templates/library/LibraryContainer.tsx b/packages/web/components/templates/library/LibraryContainer.tsx index b10024ad0..569c03937 100644 --- a/packages/web/components/templates/library/LibraryContainer.tsx +++ b/packages/web/components/templates/library/LibraryContainer.tsx @@ -162,6 +162,10 @@ export function LibraryContainer(props: LibraryContainerProps): JSX.Element { // eslint-disable-next-line react-hooks/exhaustive-deps }, [setQueryInputs, router.isReady, router.query]) + useEffect(() => { + window.localStorage.setItem('nav-return', router.asPath) + }, [router.asPath]) + const hasMore = useMemo(() => { if (!itemsPages) { return false