mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2024-11-26 17:43:48 +01:00
Fix #1901: Fix blade console command history
Up or down would not properly update the visible input value
This commit is contained in:
parent
0b71a83cfe
commit
1427993a25
@ -104,6 +104,7 @@ export function Console(props: IProps): React.ReactElement {
|
|||||||
setConsoleHistoryIndex(i);
|
setConsoleHistoryIndex(i);
|
||||||
const prevCommand = consoleHistory[i];
|
const prevCommand = consoleHistory[i];
|
||||||
event.currentTarget.value = prevCommand;
|
event.currentTarget.value = prevCommand;
|
||||||
|
setCommand(prevCommand);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (event.keyCode === 40) {
|
if (event.keyCode === 40) {
|
||||||
@ -125,6 +126,7 @@ export function Console(props: IProps): React.ReactElement {
|
|||||||
setConsoleHistoryIndex(consoleHistoryIndex + 1);
|
setConsoleHistoryIndex(consoleHistoryIndex + 1);
|
||||||
const prevCommand = consoleHistory[consoleHistoryIndex + 1];
|
const prevCommand = consoleHistory[consoleHistoryIndex + 1];
|
||||||
event.currentTarget.value = prevCommand;
|
event.currentTarget.value = prevCommand;
|
||||||
|
setCommand(prevCommand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user