forked from MapComplete/MapComplete
Fix: Actually show errors in custom themes now
This commit is contained in:
parent
adb5d892fb
commit
6a79dde743
2 changed files with 50 additions and 88 deletions
24
index.ts
24
index.ts
|
@ -6,13 +6,17 @@ import ThemeViewGUI from "./UI/ThemeViewGUI.svelte"
|
|||
import { FixedUiElement } from "./UI/Base/FixedUiElement"
|
||||
|
||||
// @ts-ignore
|
||||
DetermineLayout.GetLayout()
|
||||
.then((layout) => {
|
||||
const state = new ThemeViewState(layout)
|
||||
const main = new SvelteUIElement(ThemeViewGUI, { state })
|
||||
main.AttachTo("maindiv")
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("Error while initializing: ", err, err.stack)
|
||||
new FixedUiElement(err).SetClass("block alert").AttachTo("maindiv")
|
||||
})
|
||||
try {
|
||||
DetermineLayout.GetLayout()
|
||||
.then((layout) => {
|
||||
const state = new ThemeViewState(layout)
|
||||
const main = new SvelteUIElement(ThemeViewGUI, { state })
|
||||
main.AttachTo("maindiv")
|
||||
})
|
||||
.catch((err) => {
|
||||
console.error("Error while initializing: ", err, err.stack)
|
||||
new FixedUiElement(err).SetClass("block alert").AttachTo("maindiv")
|
||||
})
|
||||
} catch (err) {
|
||||
new FixedUiElement(err).SetClass("block alert").AttachTo("maindiv")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue