fix: cleanup page id in time (#2236)

This commit is contained in:
Himself65
2023-05-04 22:22:11 -05:00
committed by GitHub
parent 1b12972afd
commit f7d1d922fa
2 changed files with 6 additions and 2 deletions
@@ -13,6 +13,9 @@ export function useSyncRouterWithCurrentPageId(router: NextRouter) {
if (typeof pageId === 'string') {
console.log('set page id', pageId);
setCurrentPageId(pageId);
} else if (pageId === undefined) {
console.log('cleanup page');
setCurrentPageId(null);
}
}, [router.isReady, router.query.pageId, setCurrentPageId]);
}