mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-06 09:59:00 +02:00
🐛 Fix invalid query calls when navigating away from poll
This commit is contained in:
parent
1c44b3954b
commit
c58c814786
1 changed files with 9 additions and 0 deletions
|
@ -287,6 +287,15 @@ const Prefetch = ({ children }: React.PropsWithChildren) => {
|
||||||
};
|
};
|
||||||
|
|
||||||
const PollLayout = ({ children }: React.PropsWithChildren) => {
|
const PollLayout = ({ children }: React.PropsWithChildren) => {
|
||||||
|
const router = useRouter();
|
||||||
|
|
||||||
|
const urlId = router.query.urlId as string;
|
||||||
|
|
||||||
|
if (!urlId) {
|
||||||
|
// probably navigating away
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Prefetch>
|
<Prefetch>
|
||||||
<LegacyPollContextProvider>
|
<LegacyPollContextProvider>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue