fix: "← Calendar" returns to the previously viewed week
All checks were successful
Build and Deploy / Build & Push (push) Successful in 1m3s
All checks were successful
Build and Deploy / Build & Push (push) Successful in 1m3s
HomePageClient writes the current weekStart to localStorage("lastWeek")
whenever it changes. BackToCalendarLink (new client component) reads
that value on mount and builds the href — falling back to "/" if nothing
is stored (e.g. direct link to a park page).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -41,6 +41,11 @@ export function HomePageClient({
|
||||
setCoastersOnly(localStorage.getItem(COASTER_MODE_KEY) === "true");
|
||||
}, []);
|
||||
|
||||
// Remember the current week so the park page back button returns here.
|
||||
useEffect(() => {
|
||||
localStorage.setItem("lastWeek", weekStart);
|
||||
}, [weekStart]);
|
||||
|
||||
const toggle = () => {
|
||||
const next = !coastersOnly;
|
||||
setCoastersOnly(next);
|
||||
|
||||
Reference in New Issue
Block a user