fix terminal not cancelling.

This commit is contained in:
Olivier Gagnon
2021-09-19 03:29:36 -04:00
parent 374b81ffae
commit cd0aa192f5
2 changed files with 1 additions and 1 deletions

@ -245,6 +245,7 @@ export class Terminal implements ITerminal {
this.print("Cancelled"); this.print("Cancelled");
} }
this.action = null; this.action = null;
console.log("done");
TerminalEvents.emit(); TerminalEvents.emit();
} }

@ -149,7 +149,6 @@ export function TerminalInput({ terminal, router, player }: IProps): React.React
useEffect(() => { useEffect(() => {
function keyDown(this: Document, event: KeyboardEvent): void { function keyDown(this: Document, event: KeyboardEvent): void {
if (terminal.contractOpen) return; if (terminal.contractOpen) return;
if (event.metaKey || event.ctrlKey) return;
const ref = terminalInput.current; const ref = terminalInput.current;
if (ref) ref.focus(); if (ref) ref.focus();
// Cancel action // Cancel action