Fix student profile dates not saving

Native date pickers blur/refocus the window, which triggered a React Query
refetch mid-edit and wiped the in-progress date. Disable refetchOnWindowFocus,
and make profile/academics edits work on a snapshot with functional state
updates so a background refetch can't clobber input.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-07-19 17:50:53 -04:00
co-authored by Claude Opus 4.8
parent 8880d7a805
commit eb94c7ec34
2 changed files with 24 additions and 12 deletions
+8 -1
View File
@@ -3,7 +3,14 @@ import { createRouter } from "@tanstack/react-router";
import { routeTree } from "./routeTree.gen";
export const getRouter = () => {
const queryClient = new QueryClient();
const queryClient = new QueryClient({
defaultOptions: {
// Don't refetch when the window regains focus — opening a native date
// picker blurs/refocuses the window, which would refetch mid-edit and
// wipe in-progress form input.
queries: { refetchOnWindowFocus: false },
},
});
const router = createRouter({
routeTree,