diff --git a/docs/cli-config.md b/docs/cli-config.md index c2ce326..8b0ae6e 100644 --- a/docs/cli-config.md +++ b/docs/cli-config.md @@ -102,7 +102,7 @@ Uses **Commander.js** for command parsing. ### Accounts (`cw account`) | Command | Description | |---------|-------------| -| `add [--provider] [--email]` | Auto-discover or manually register account | +| `add [--provider] [--email] [--token]` | Auto-discover, manually register, or register with setup token | | `list` | Show accounts with exhaustion status | | `remove ` | Remove account | | `refresh` | Clear expired exhaustion markers | diff --git a/packages/web/src/lib/invalidation.ts b/packages/web/src/lib/invalidation.ts index d94f370..39851ab 100644 --- a/packages/web/src/lib/invalidation.ts +++ b/packages/web/src/lib/invalidation.ts @@ -103,7 +103,7 @@ function extractProcedureName(mutationKey: unknown): MutationName | null { * Creates a MutationCache with a global onSuccess handler that automatically * invalidates the relevant queries for each tRPC mutation. */ -export function createMutationCache(queryClient: QueryClient): MutationCache { +export function createMutationCache(getQueryClient: () => QueryClient): MutationCache { return new MutationCache({ onSuccess: (_data, _variables, _context, mutation) => { const name = extractProcedureName(mutation.options.mutationKey); @@ -112,6 +112,7 @@ export function createMutationCache(queryClient: QueryClient): MutationCache { const queriesToInvalidate = INVALIDATION_MAP[name]; if (!queriesToInvalidate) return; + const queryClient = getQueryClient(); for (const queryName of queriesToInvalidate) { void queryClient.invalidateQueries({ queryKey: [[queryName]],