diff options
Diffstat (limited to 'packages/anastasis-webui/src/main.ts')
-rw-r--r-- | packages/anastasis-webui/src/main.ts | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/packages/anastasis-webui/src/main.ts b/packages/anastasis-webui/src/main.ts new file mode 100644 index 000000000..ee839bc4e --- /dev/null +++ b/packages/anastasis-webui/src/main.ts @@ -0,0 +1,29 @@ +import { setupI18n } from "@gnu-taler/taler-util"; +import { h, render } from "preact"; +import App from "./components/app"; +//import "./scss/main.scss"; + +export default App; + +function main(): void { + try { + const container = document.getElementById("container"); + if (!container) { + throw Error("container not found, can't mount page contents"); + } + render(h(App, {}), container); + } catch (e) { + console.error("got error", e); + if (e instanceof Error) { + document.body.innerText = `Fatal error: "${e.message}". Please report this bug at https://bugs.gnunet.org/.`; + } + } +} + +// setupI18n("en", strings); + +if (document.readyState === "loading") { + document.addEventListener("DOMContentLoaded", main); +} else { + main(); +} |