MCPcopy
hub / github.com/monkeytypegame/monkeytype / set

Function set

frontend/src/ts/controllers/theme-controller.ts:138–151  ·  view source on GitHub ↗
(
  themeIdentifier: ThemeIdentifier,
  isAutoSwitch = false,
)

Source from the content-addressed store, hash-verified

136});
137
138async function set(
139 themeIdentifier: ThemeIdentifier,
140 isAutoSwitch = false,
141): Promise<void> {
142 console.debug("Theme controller setting theme", themeIdentifier, {
143 isAutoSwitch,
144 });
145 await apply(themeIdentifier, undefined, isAutoSwitch);
146
147 if (!isAutoSwitch && Config.autoSwitchTheme) {
148 setConfig("autoSwitchTheme", false);
149 showNoticeNotification("Auto switch theme disabled");
150 }
151}
152
153export async function clearPreview(applyTheme = true): Promise<void> {
154 previewState = null;

Callers 2

AccountXpBarFunction · 0.50

Calls 3

setConfigFunction · 0.90
showNoticeNotificationFunction · 0.90
applyFunction · 0.70

Tested by

no test coverage detected