@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 29 lines 916 Bytes
Raw
1 const STORAGE_KEY = "t3code:snap-shot-setup-resume:v1";
2 let startupChecked = false;
3
4 export function readSnapShotSetupResume(): { wasEnabled: boolean } | null {
5 try {
6 const value = window.localStorage.getItem(STORAGE_KEY);
7 if (value === "enabled" || value === "disabled") return { wasEnabled: value === "enabled" };
8 } catch {}
9 return null;
10 }
11
12 export function saveSnapShotSetupResume(wasEnabled: boolean): void {
13 try {
14 window.localStorage.setItem(STORAGE_KEY, wasEnabled ? "enabled" : "disabled");
15 } catch {}
16 }
17
18 export function clearSnapShotSetupResume(): void {
19 try {
20 window.localStorage.removeItem(STORAGE_KEY);
21 } catch {}
22 }
23
24 // Check once per startup so opening System Settings cannot redirect later navigation.
25 export function shouldResumeSnapShotSetupOnStartup(): boolean {
26 if (startupChecked) return false;
27 startupChecked = true;
28 return readSnapShotSetupResume() !== null;
29 }