MCPcopy
hub / github.com/ys1231/MoveCertificate / switchModeHandler

Function switchModeHandler

webdev/src/main.ts:258–267  ·  view source on GitHub ↗
(newMode)

Source from the content-addressed store, hash-verified

256
257 // 切换模式的处理函数(声明提前,避免 TDZ 问题)
258 const switchModeHandler: SwitchModeHandler = (newMode) => {
259 setMode(newMode).then(() => {
260 currentMode = newMode;
261 const modeLabel = t(newMode === 'compatible' ? 'compatibleMode' : 'builtinMode');
262 toast(t('modeSwitched', modeLabel));
263 renderModeConfig('modeConfig', currentMode, switchModeHandler);
264 }).catch(() => {
265 toast(t('modeSwitchFailed'));
266 });
267 };
268
269 try {
270 currentMode = await getCurrentMode();

Callers

nothing calls this directly

Calls 3

setModeFunction · 0.85
tFunction · 0.85
renderModeConfigFunction · 0.85

Tested by

no test coverage detected