feat: show contacts from all logged-in accounts in Pro shell

This commit is contained in:
Linus Rath
2026-05-21 22:32:17 +02:00
parent 2c825af689
commit e80412b6fd
8 changed files with 438 additions and 51 deletions
+23
View File
@@ -0,0 +1,23 @@
import type { IJMAPClient } from '@/lib/jmap/client-interface';
/**
* Tiny indirection used by the calendar and contact stores to look up a
* JMAP client by local account ID without importing `auth-store` directly
* — that would form a top-level cycle (auth-store already imports the
* feature stores to bootstrap them after login).
*
* `auth-store` registers its `getClientForAccount` on module init via
* `setClientLookup`; the feature stores call `getClientByLocalAccountId`
* inside their mutations.
*/
type ClientLookup = (localAccountId: string) => IJMAPClient | undefined;
let lookup: ClientLookup | null = null;
export function setClientLookup(fn: ClientLookup): void {
lookup = fn;
}
export function getClientByLocalAccountId(localAccountId: string): IJMAPClient | undefined {
return lookup ? lookup(localAccountId) : undefined;
}