Skip to content

fix(calendar): sign in again on a 401 when saving, and reset Save - #166

Merged
selvarajuv merged 2 commits into
mainfrom
night-page-fixes
Nov 29, 2026
Merged

selvarajuv merged 2 commits into
mainfrom
night-page-fixes

Conversation

@Jrodrigo06

Copy link
Copy Markdown
Collaborator

What

Two small fixes on the night page from the #162 review:

  • A save that gets a 401 (session expired) now sends the browser to sign in, as every GET already does, instead of showing "Couldn't save".
  • "Your rate" puts its button back to Save after a successful save, instead of relying on the reload rebuilding the card.

Why

Both were flagged in the #162 review. The second one works today only because the page shows a loading state while it reloads; any change to that would leave the button stuck on "Saving…".

How to check

  • just dev --neon and just frontend, open a night, save a rate: it saves and the button reads Save again.
  • Sign out in another tab, then press Save: the page goes to sign in and comes back to the night afterwards.

Notes

  • Sign out also uses apiPost. With an expired session it now lands on sign in through the redirect, which is where it was going anyway.
  • The third point from the review (the field starts at our rate, so an unchanged save records our own price) is left alone: it's an open question in docs/open-questions.md.

A manager whose session expired saw "Couldn't save" on the night page instead of being asked to sign in again, unlike every GET.
It only went back to Save because reloading the night rebuilt the card; keeping the page on screen while it reloads would have left it on Saving… for good.
@selvarajuv
selvarajuv merged commit 82d015f into main Nov 29, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants