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

@@ -14,11 +14,13 @@ export type PersistedAppData = {
export type CommandResultView = {
key: number,
input: string,
view: JSX.Element
view: ViewFactory
};
export type AppStateChangeHandler = (state: AppState) => void;
type ViewFactory = () => JSX.Element;
export default class AppState {
version: number = APP_VERSION;
@@ -47,7 +49,7 @@ export default class AppState {
this.donationClicked = persistData.donationClicked;
}
addCommandResult(input : string, view : JSX.Element) {
addCommandResult(input : string, view : ViewFactory) {
const key = generateKey();
this.commandResults.unshift({key, input, view});
log.debug(`command result added: ${input}`);