The best way to control Claude Code, Codex and more from any computer or phone

main
ts 19 lines 851 Bytes
Raw
1 import { loadPreferences, updatePreferences } from "../../persistence/imperative";
2
3 // Lives apart from connectOnboarding.ts so cloudAccountService.ts (which
4 // imports the request signal) never pulls the persistence adapter into its
5 // module graph; that breaks CloudAuthProvider.test.ts suite loading.
6
7 export async function isConnectOnboardingOptedOut(accountId: string): Promise<boolean> {
8 const preferences = await loadPreferences();
9 return preferences.connectOnboardingOptOutAccounts?.includes(accountId) ?? false;
10 }
11
12 export async function optOutOfConnectOnboarding(accountId: string): Promise<void> {
13 await updatePreferences((current) => {
14 const optedOut = current.connectOnboardingOptOutAccounts ?? [];
15 return optedOut.includes(accountId)
16 ? {}
17 : { connectOnboardingOptOutAccounts: [...optedOut, accountId] };
18 });
19 }