(fix) - regression to quit shortcut from command migration (#4374)
This commit is contained in:
parent
fc8c38b2bc
commit
79d36ac0a5
|
@ -432,15 +432,8 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
if (timerRef.current) {
|
if (timerRef.current) {
|
||||||
clearTimeout(timerRef.current);
|
clearTimeout(timerRef.current);
|
||||||
}
|
}
|
||||||
const quitCommand = slashCommands.find(
|
// Directly invoke the central command handler.
|
||||||
(cmd) => cmd.name === 'quit' || cmd.altName === 'exit',
|
handleSlashCommand('/quit');
|
||||||
);
|
|
||||||
if (quitCommand && quitCommand.action) {
|
|
||||||
quitCommand.action(commandContext, '');
|
|
||||||
} else {
|
|
||||||
// This is unlikely to be needed but added for an additional fallback.
|
|
||||||
process.exit(0);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
setPressedOnce(true);
|
setPressedOnce(true);
|
||||||
timerRef.current = setTimeout(() => {
|
timerRef.current = setTimeout(() => {
|
||||||
|
@ -449,8 +442,7 @@ const App = ({ config, settings, startupWarnings = [], version }: AppProps) => {
|
||||||
}, CTRL_EXIT_PROMPT_DURATION_MS);
|
}, CTRL_EXIT_PROMPT_DURATION_MS);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// Add commandContext to the dependency array here!
|
[handleSlashCommand],
|
||||||
[slashCommands, commandContext],
|
|
||||||
);
|
);
|
||||||
|
|
||||||
useInput((input: string, key: InkKeyType) => {
|
useInput((input: string, key: InkKeyType) => {
|
||||||
|
|
Loading…
Reference in New Issue