Add some safeguards to data and new button size
This commit is contained in:
@@ -16,16 +16,17 @@ function MyApp({ Component, pageProps: { session, ...pageProps } }: AppProps) {
|
||||
const router = useRouter();
|
||||
const slug = router.query?.slug;
|
||||
const gistId = (Array.isArray(slug) && slug[0]) ?? null;
|
||||
|
||||
useEffect(() => {
|
||||
if (gistId && router.isReady) {
|
||||
fetchFiles(gistId);
|
||||
} else {
|
||||
if (!gistId && router.isReady) {
|
||||
state.mainModalOpen = true;
|
||||
if (router.pathname.includes("/develop")) {
|
||||
if (gistId && router.isReady) {
|
||||
fetchFiles(gistId);
|
||||
} else {
|
||||
if (!gistId && router.isReady) {
|
||||
state.mainModalOpen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}, [gistId, router.isReady]);
|
||||
}, [gistId, router.isReady, router.pathname]);
|
||||
|
||||
return (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user