The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 04:45 UTC
| 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 | } |