fix: load hook timing

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-20 02:15:12 +01:00
parent f5f16b6c43
commit 68b7d99a9c
+3
View File
@@ -185,6 +185,8 @@ store.dimensions = {
invoke(async () => { invoke(async () => {
await until(() => !isNaN(width.value) && width.value > 0 && !isNaN(height.value) && height.value > 0).toBeTruthy() await until(() => !isNaN(width.value) && width.value > 0 && !isNaN(height.value) && height.value > 0).toBeTruthy()
await until(store.elements).toMatch((y) => y.length > 0)
await nextTick(() => {
const instance: FlowInstance = { const instance: FlowInstance = {
fitView: (params = { padding: 0.1 }) => fitView(params), fitView: (params = { padding: 0.1 }) => fitView(params),
zoomIn, zoomIn,
@@ -199,6 +201,7 @@ invoke(async () => {
store.isReady = true store.isReady = true
store.instance = instance store.instance = instance
}) })
})
watch( watch(
[width, height], [width, height],