Fix reinstantiating app when builder props change
This commit is contained in:
parent
999b2ffb19
commit
99c167c54f
|
@ -1,9 +1,14 @@
|
||||||
import ClientApp from "./components/ClientApp.svelte"
|
import ClientApp from "./components/ClientApp.svelte"
|
||||||
|
|
||||||
// Initialise client app
|
let app
|
||||||
|
|
||||||
const loadBudibase = () => {
|
const loadBudibase = () => {
|
||||||
window.document.body.innerHTML = ""
|
// Destroy old app if one exists
|
||||||
new ClientApp({
|
if (app) {
|
||||||
|
app.$destroy()
|
||||||
|
}
|
||||||
|
// Create new app
|
||||||
|
app = new ClientApp({
|
||||||
target: window.document.body,
|
target: window.document.body,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue