From 4a14f8b3f1fbad09b390a003f9b06736fd1af505 Mon Sep 17 00:00:00 2001 From: derekc Date: Sun, 1 Mar 2026 21:13:05 -0800 Subject: [PATCH] Fix timezone resetting to UTC on page reload MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On reload, the access token existed in localStorage so isAuthenticated was true, but user.value was null — fetchMe was never called, so authStore.timezone fell back to 'UTC' before the component mounted. Router guard now calls fetchMe() when authenticated but user data is not yet loaded, ensuring user preferences are available to all auth-required pages on the first render after a reload. Co-Authored-By: Claude Sonnet 4.6 --- frontend/src/router/index.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 4109adf..179ac89 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -52,6 +52,9 @@ router.beforeEach(async (to) => { if (!auth.isAuthenticated) { return { name: 'login', query: { redirect: to.fullPath } } } + } else if (!auth.user) { + // Token exists but user data not loaded yet (e.g. page reload) — fetch it now + await auth.fetchMe() } } })