Make em toggle affect existing results

This commit is contained in:
BorysLevytskyi
2023-05-06 20:50:22 +02:00
parent e8e6e4697a
commit 6625e475e1
7 changed files with 25 additions and 25 deletions

View File

@@ -17,19 +17,19 @@ const shellModule = {
cmd.debugMode = appState.debugMode;
appState.onChange(() => cmd.debugMode = appState.debugMode);
cmd.command("help", (c: CommandInput) => appState.addCommandResult(c.input, <HelpResultView />));
cmd.command("help", (c: CommandInput) => appState.addCommandResult(c.input, () => <HelpResultView />));
cmd.command("clear", () => appState.clearCommandResults());
cmd.command("em", () => appState.toggleEmphasizeBytes());
cmd.command("dark", () => appState.setUiTheme('dark'));
cmd.command("light", () => appState.setUiTheme('light'));
cmd.command("midnight", () => appState.setUiTheme('midnight'));
cmd.command("about", (c: CommandInput) => appState.addCommandResult(c.input, <AboutResultView />));
cmd.command("whatsnew", (c: CommandInput) => appState.addCommandResult(c.input, <WhatsnewResultView />));
cmd.command("guid", (c: CommandInput) => appState.addCommandResult(c.input, <TextResultView text={uuid()} />));
cmd.command("about", (c: CommandInput) => appState.addCommandResult(c.input, () => <AboutResultView />));
cmd.command("whatsnew", (c: CommandInput) => appState.addCommandResult(c.input, () => <WhatsnewResultView />));
cmd.command("guid", (c: CommandInput) => appState.addCommandResult(c.input, () => <TextResultView text={uuid()} />));
cmd.command("-notrack", () => {});
cmd.command("-debug", (c: CommandInput) => {
appState.toggleDebugMode();
appState.addCommandResult(c.input, <TextResultView text={`Debug Mode: ${appState.debugMode}`}/>);
appState.addCommandResult(c.input, () => <TextResultView text={`Debug Mode: ${appState.debugMode}`}/>);
});
cmd.command("donate", (c:CommandInput) => {
@@ -73,12 +73,12 @@ const shellModule = {
const command = s.input.substring(7).trim();
const result = executeCommand(command);
appState.addCommandResult(s.input, <TextResultView text={result} />);
appState.addCommandResult(s.input, () => <TextResultView text={result} />);
}
});
};
cmd.onError((input: string, err: Error) => appState.addCommandResult(input, <ErrorResultView errorMessage={err.toString()} />));
cmd.onError((input: string, err: Error) => appState.addCommandResult(input, () => <ErrorResultView errorMessage={err.toString()} />));
}
}