fix: refresh profile after email verification - #27
Conversation
|
Superseded. This PR has been rewritten as a single independent change against current The earlier branch was based on |
260fe99 to
5a576a7
Compare
|
tanstack's refetchOnFocus should do this ? |
5a576a7 to
383ca37
Compare
|
Yes — that's all it needed. It's now just a per-query Dropped the global focus listener and the token guards, so this is one file now. One thing worth flagging: 5.102.8's default focus listener subscribes to |
|
Correct, but data?.data? is redundant, data?.data.xxx is correct ps. ur correct, it won't work for an app, and the fix is specified in the respective docs |
|
Fixed in 7876963 — dropped the inner |
An unverified user can verify in another tab or window while an open Lachesis window keeps the stale profile, so its banner and gates remain visible. The profile query was not refreshed: Lachesis sets TanStack Query's global
refetchOnWindowFocustofalsebecause other refetches are manual.This change opts only the profile query back in with a conditional
refetchOnWindowFocus; it stops opting in onceemailVerifiedis true, so verified users make no further focus-triggered profile requests.Baseline: installed TanStack Query 5.102.8's stock focus listener subscribes to
visibilitychangeonly. A focused harness against that package refetched on hidden-to-visible and did not react to a barewindowfocusevent. Thus the browser tab-return path is covered; a Tauri window regaining native focus while visibility stays visible is not. Separate issue: Tauri native-window focus refresh.The replacement global
focusManager.setEventListenerwas deliberately removed, along with the login-token query/startup-prefetch guards. This pull request is one file and only addresses the profile refresh.