fix: read activeAccountId from authStore in account selectors

This commit is contained in:
Linus Rath
2026-05-05 21:20:45 +02:00
parent 9f67bc078a
commit ef8eb1d73b
2 changed files with 7 additions and 2 deletions
+3 -1
View File
@@ -184,7 +184,9 @@ export function NavigationRail({
// Account list for rail
const accounts = useAccountStore((s) => s.accounts);
const activeAccountId = useAccountStore((s) => s.activeAccountId);
// Read activeAccountId from authStore so the rail's account row matches the actually-loaded
// session — accountStore has its own persisted copy that can drift out of sync.
const activeAccountId = useAuthStore((s) => s.activeAccountId);
const switchAccount = useAuthStore((s) => s.switchAccount);
const logout = useAuthStore((s) => s.logout);
const logoutAll = useAuthStore((s) => s.logoutAll);