From 8dc09555fd82d776492ac896ef4c3864d36220df Mon Sep 17 00:00:00 2001 From: kwaroran Date: Mon, 15 Jan 2024 16:05:50 +0900 Subject: [PATCH] Add JavaScript disabled message and error handling to app div --- index.html | 9 ++++++++- src/main.ts | 22 ++++++++++++++-------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/index.html b/index.html index e4b716a3..ccf900bc 100644 --- a/index.html +++ b/index.html @@ -10,7 +10,14 @@ -
+
+ +
diff --git a/src/main.ts b/src/main.ts index 5cd77864..4139b8b1 100644 --- a/src/main.ts +++ b/src/main.ts @@ -6,14 +6,20 @@ import { initHotkey } from "./ts/hotkey"; import { polyfill } from "./ts/polyfill"; import { watchParamButton } from "./ts/plugins/embedscript"; -polyfill() +let app: App; +try { + polyfill() -const app = new App({ - target: document.getElementById("app"), -}); - -loadData() -initHotkey() -watchParamButton() + app = new App({ + target: document.getElementById("app"), + }); + + loadData() + initHotkey() + watchParamButton() +} catch (error) { + console.error(error, error.stack) + alert(error) +} export default app; \ No newline at end of file