fix: sync identity stores and append signatures to outgoing emails (#15)
- Add syncIdentities() to auth store to propagate identity changes from identity store, fixing stale data that caused save failures and duplicates - Call syncIdentities() after every create, update, and delete in the identity manager modal - Switch email composer to read identities from identity store for consistency with the rest of the app - Append identity text signature (with RFC 3676 separator) to email body when sending from the composer and quick reply paths - Add tests for syncIdentities and signature appending logic
This commit is contained in:
@@ -33,6 +33,7 @@ interface AuthState {
|
||||
logout: () => void;
|
||||
checkAuth: () => Promise<void>;
|
||||
clearError: () => void;
|
||||
syncIdentities: () => void;
|
||||
}
|
||||
|
||||
const ERROR_PATTERNS: Array<{ key: string; matches: string[] }> = [
|
||||
@@ -479,6 +480,13 @@ export const useAuthStore = create<AuthState>()(
|
||||
},
|
||||
|
||||
clearError: () => set({ error: null }),
|
||||
|
||||
syncIdentities: () => {
|
||||
const identityState = useIdentityStore.getState();
|
||||
const identities = identityState.identities;
|
||||
const primaryIdentity = identities[0] ?? null;
|
||||
set({ identities, primaryIdentity });
|
||||
},
|
||||
}),
|
||||
{
|
||||
name: 'auth-storage',
|
||||
|
||||
Reference in New Issue
Block a user