fix(store): zoom related state to update when flow is ready

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-28 10:01:23 +01:00
parent 796c60431f
commit 229bbb7a3c
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -189,7 +189,7 @@ const { width, height } = useElementBounding(zoomPaneEl)
// skip waiting for ssr
const window = useWindow()
if ('screen' in window) await until(() => store.isReady).toMatch((y) => y)
if ('screen' in window) await until(() => store.isReady).toBe(true)
watch(
[width, height],
+6
View File
@@ -223,6 +223,12 @@ export default (id: string, preloadedState: FlowState) => {
if (typeof state.translateExtent !== 'undefined') this.setTranslateExtent(state.translateExtent)
if (typeof state.nodeExtent !== 'undefined') this.setNodeExtent(state.nodeExtent)
})
else {
if (typeof state.maxZoom !== 'undefined') this.setMaxZoom(state.maxZoom)
if (typeof state.minZoom !== 'undefined') this.setMinZoom(state.minZoom)
if (typeof state.translateExtent !== 'undefined') this.setTranslateExtent(state.translateExtent)
if (typeof state.nodeExtent !== 'undefined') this.setNodeExtent(state.nodeExtent)
}
},
},
})