MCPcopy Index your code
hub / github.com/coder/coder / draftToUpdate

Function draftToUpdate

site/src/theme/themeMode.ts:145–163  ·  view source on GitHub ↗
(
	draft: ThemeModeDraft,
	terminalFont: TerminalFontName,
	activeScheme: "dark" | "light",
)

Source from the content-addressed store, hash-verified

143};
144
145export const draftToUpdate = (
146 draft: ThemeModeDraft,
147 terminalFont: TerminalFontName,
148 activeScheme: "dark" | "light",
149): AppearanceUpdate => {
150 const themePreference =
151 draft.mode === "single"
152 ? draft.single
153 : activeScheme === "dark"
154 ? draft.dark
155 : draft.light;
156 return {
157 theme_preference: themePreference,
158 theme_mode: draft.mode,
159 theme_light: draft.light,
160 theme_dark: draft.dark,
161 terminal_font: terminalFont,
162 };
163};
164
165export const draftFromState = (
166 state: ThemeModeState,

Callers 2

themeMode.test.tsFile · 0.90
toUpdateRequestFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected