fix: improve draft handling in email composer and enhance session cookie verification logic

This commit is contained in:
Linus Rath
2026-03-20 15:45:25 +01:00
parent c5b1731a63
commit c1c06c68bb
3 changed files with 29 additions and 12 deletions
+6 -2
View File
@@ -691,7 +691,9 @@ export const useAuthStore = create<AuthState>()(
const targetAccount = accountStore.getAccountById(accountId);
if (!targetAccount) return;
set({ isLoading: true });
// Null out the client immediately so the page doesn't fire data-loading
// effects with the old client while stores are being cleared.
set({ isLoading: true, client: null });
// Snapshot current account
if (state.activeAccountId) {
@@ -827,7 +829,9 @@ export const useAuthStore = create<AuthState>()(
// Multi-account restoration: restore all registered accounts
if (accounts.length > 0) {
set({ isLoading: true });
// Null out client so the page doesn't fire data-loading effects
// with a stale client reference while we're restoring accounts.
set({ isLoading: true, client: null });
// Determine which account to activate first
const defaultAccount = accountStore.getDefaultAccount();