MCPcopy Create free account
hub / github.com/code-with-antonio/nightcode / persistTheme

Function persistTheme

packages/cli/src/providers/theme/index.tsx:28–39  ·  view source on GitHub ↗
(theme: Theme)

Source from the content-addressed store, hash-verified

26};
27
28function persistTheme(theme: Theme) {
29 try {
30 mkdirSync(CONFIG_DIR, { recursive: true });
31 writeFileSync(
32 THEME_PREFERENCES_PATH,
33 JSON.stringify({ themeName: theme.name } satisfies ThemePreferences, null, 2),
34 "utf8",
35 );
36 } catch {
37 // Ignore preference write failures so theme switching still works for this session.
38 }
39};
40
41type ThemeContextValue = {
42 colors: ThemeColors;

Callers 1

ThemeProviderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected