1
0
Fork 0
mirror of synced 2024-10-03 02:27:06 +13:00

Fix reinstantiating app when builder props change

This commit is contained in:
Andrew Kingston 2020-11-23 14:28:02 +00:00
parent 999b2ffb19
commit 99c167c54f

View file

@ -1,9 +1,14 @@
import ClientApp from "./components/ClientApp.svelte"
// Initialise client app
let app
const loadBudibase = () => {
window.document.body.innerHTML = ""
new ClientApp({
// Destroy old app if one exists
if (app) {
app.$destroy()
}
// Create new app
app = new ClientApp({
target: window.document.body,
})
}