mirror of
https://github.com/bitburner-official/bitburner-src.git
synced 2026-04-25 02:32:55 +02:00
fix
This commit is contained in:
@@ -32,6 +32,16 @@ export function AlertManager(): React.ReactElement {
|
||||
[],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
function handle(this: Document, event: KeyboardEvent): void {
|
||||
if (event.code === "Escape") {
|
||||
setAlerts([]);
|
||||
}
|
||||
}
|
||||
document.addEventListener("keydown", handle);
|
||||
return () => document.removeEventListener("keydown", handle);
|
||||
}, []);
|
||||
|
||||
function close(): void {
|
||||
setAlerts((old) => {
|
||||
return old.slice(1, 1e99);
|
||||
|
||||
Reference in New Issue
Block a user