perf: no wait for session when calling getschedule 10552 cal 2311 (#10607)
* No batching on getting session * Fix usePublicPage hook to use new router search params * Move things so getSchedule data can be load as soon as we are rendering BookerComponent * pre fetch session * Removed custom code in favour of useTimePreferences --------- Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
1 parent
bee5011ec1
commit
fcd892bfa0
9 files changed
+129
-32
No files matched your search
@@ -0,0 +1,12 @@
|
||||
import { usePathname, useSearchParams } from "next/navigation";
|
||||
|
||||
export default function useIsBookingPage() {
|
||||
const pathname = usePathname();
|
||||
const isBookingPage = ["/booking", "/cancel", "/reschedule"].some((route) => pathname?.startsWith(route));
|
||||
|
||||
const searchParams = useSearchParams();
|
||||
const userParam = searchParams.get("user");
|
||||
const teamParam = searchParams.get("team");
|
||||
|
||||
return !!(isBookingPage || userParam || teamParam);
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
import { usePathname } from "next/navigation";
|
||||
|
||||
export default function usePublicPage() {
|
||||
const pathname = usePathname();
|
||||
const isPublicPage = ["/[user]", "/booking", "/cancel", "/reschedule"].find((route) =>
|
||||
pathname?.startsWith(route)
|
||||
);
|
||||
return isPublicPage;
|
||||
}
|
||||
Reference in new issue
Block a user