Show a crash dialog when the editor panics (#362)

* Show a crash dialog when the editor panics

Closes #357

* Suppress console usage lints

* Proxy cleanup and comments
This commit is contained in:
Keavon Chambers
2021-08-31 18:34:19 -07:00
parent c8389bbae1
commit d290aaf712
16 changed files with 212 additions and 32 deletions
+7 -4
View File
@@ -1,7 +1,8 @@
import { toggleFullscreen } from "@/utilities/fullscreen";
import { dialogIsVisible, dismissDialog, submitDialog } from "@/utilities/dialog";
import { panicProxy } from "@/utilities/panic";
const wasm = import("@/../wasm/pkg");
const wasm = import("@/../wasm/pkg").then(panicProxy);
let viewportMouseInteractionOngoing = false;
@@ -45,10 +46,12 @@ export async function onKeyDown(e: KeyboardEvent) {
if (dialogIsVisible()) {
if (e.key === "Escape") dismissDialog();
if (e.key === "Enter") submitDialog();
if (e.key === "Enter") {
submitDialog();
// Prevent the Enter key from acting like a click on the last clicked button, which might reopen the dialog
e.preventDefault();
// Prevent the Enter key from acting like a click on the last clicked button, which might reopen the dialog
e.preventDefault();
}
}
}