Merge pull request #4107 from omnivore-app/feat/web-return
feat/web return
This commit is contained in:
@ -21,10 +21,16 @@ export function OmnivoreLogoBase(props: OmnivoreLogoBaseProps): JSX.Element {
|
|||||||
alignItems: 'center',
|
alignItems: 'center',
|
||||||
}}
|
}}
|
||||||
onClick={(event) => {
|
onClick={(event) => {
|
||||||
|
const navReturn = window.localStorage.getItem('nav-return')
|
||||||
|
if (navReturn) {
|
||||||
|
window.location.assign(navReturn)
|
||||||
|
return
|
||||||
|
}
|
||||||
const query = window.sessionStorage.getItem('q')
|
const query = window.sessionStorage.getItem('q')
|
||||||
if (query) {
|
if (query) {
|
||||||
router.push(`/home?${query}`)
|
window.location.assign(`/l/home?${query}`)
|
||||||
event.preventDefault()
|
} else {
|
||||||
|
window.location.replace(`/l/home`)
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
tabIndex={-1}
|
tabIndex={-1}
|
||||||
|
|||||||
@ -162,6 +162,10 @@ export function LibraryContainer(props: LibraryContainerProps): JSX.Element {
|
|||||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
}, [setQueryInputs, router.isReady, router.query])
|
}, [setQueryInputs, router.isReady, router.query])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
window.localStorage.setItem('nav-return', router.asPath)
|
||||||
|
}, [router.asPath])
|
||||||
|
|
||||||
const hasMore = useMemo(() => {
|
const hasMore = useMemo(() => {
|
||||||
if (!itemsPages) {
|
if (!itemsPages) {
|
||||||
return false
|
return false
|
||||||
|
|||||||
Reference in New Issue
Block a user