Commit 6b8fb8f
fix(agentex-ui): reset account-scoped queries on switch to avoid stale flash
Switching accounts closes the open task (task_id cleared), which flips PrimaryContent
from ChatView to HomeView immediately. HomeView rendered the agents list from the
still-cached previous account (invalidateQueries keeps data during the refetch), so the
new account briefly flashed the old account's agents before recalibrating.
Use resetQueries instead: the previous account's agents/tasks are dropped on switch, so
HomeView shows a loading state until the new account's data lands — never stale data.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>1 parent 5f243a0 commit 6b8fb8f
1 file changed
Lines changed: 10 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | | - | |
42 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
43 | 45 | | |
44 | | - | |
| 46 | + | |
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| |||
50 | 52 | | |
51 | 53 | | |
52 | 54 | | |
53 | | - | |
| 55 | + | |
54 | 56 | | |
55 | | - | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | | - | |
70 | | - | |
| 71 | + | |
| 72 | + | |
71 | 73 | | |
72 | 74 | | |
73 | 75 | | |
| |||
0 commit comments