fix: include sender display name in From header and default identity selection

- Emails now include the identity display name in the From field so recipients
  see "Name <email>" instead of bare "<email>"
- Primary identity (matching login username) is pre-selected in composer dropdown
This commit is contained in:
Matthieu MALVACHE
2026-02-25 12:35:39 +01:00
committed by Matthieu MALVACHE
parent ff3ae80f23
commit 02f4ce81e3
6 changed files with 35 additions and 12 deletions
+6 -1
View File
@@ -46,7 +46,12 @@ export const useAuthStore = create<AuthState>()(
const client = new JMAPClient(serverUrl, username, effectivePassword);
await client.connect();
const identities = await client.getIdentities();
const rawIdentities = await client.getIdentities();
const identities = [...rawIdentities].sort((a, b) => {
const aMatch = a.email === username ? -1 : 0;
const bMatch = b.email === username ? -1 : 0;
return aMatch - bMatch;
});
const primaryIdentity = identities.length > 0 ? identities[0] : null;
useIdentityStore.getState().setIdentities(identities);