diff --git a/components/Layouts/AppLayout.tsx b/components/Layouts/AppLayout.tsx index 62ea9666..7708a845 100644 --- a/components/Layouts/AppLayout.tsx +++ b/components/Layouts/AppLayout.tsx @@ -13,6 +13,7 @@ type Props = { } const AppLayout = ({ children, username }: Props) => { + const router = useRouter() const { memo } = useRouter().query const [openSideBar, setOpenSideBar] = React.useState(false) const [copied, setCopied] = React.useState(false) @@ -35,12 +36,27 @@ const AppLayout = ({ children, username }: Props) => { setOpenSideBar(false) } + const navigateHome = () => { + let pathname = "/" + if (username) pathname = `/${username}` + router.push( + { + pathname, + }, + undefined, + { shallow: true }, + ) + setTimeout(function () { + router.reload() // Force a reload after a short delay to allow location href to update + }, 200) + } + return (