budibase/packages/builder/src/App.svelte

32 lines
848 B
Svelte
Raw Normal View History

2019-07-13 11:35:57 +02:00
<script>
import Modal from "svelte-simple-modal"
2020-02-03 10:50:30 +01:00
import { onMount } from "svelte"
import { Router, basepath } from "@sveltech/routify"
2020-05-19 16:45:09 +02:00
import { routes } from "../routify/routes"
2020-04-02 15:16:46 +02:00
import { store, initialise } from "builderStore"
import AppNotification, {
showAppNotification,
} from "components/common/AppNotification.svelte"
2020-06-01 11:41:28 +02:00
import { NotificationDisplay } from "@beyonk/svelte-notifications"
2020-02-03 10:50:30 +01:00
2020-03-30 22:14:41 +02:00
function showErrorBanner() {
showAppNotification({
status: "danger",
message:
"Whoops! Looks like we're having trouble. Please refresh the page.",
})
}
onMount(async () => {
2020-03-30 22:14:41 +02:00
window.addEventListener("error", showErrorBanner)
window.addEventListener("unhandledrejection", showErrorBanner)
})
$basepath = "/_builder"
2019-07-13 11:35:57 +02:00
</script>
<NotificationDisplay />
<Modal>
<Router {routes} />
</Modal>