From 229bbb7a3c38af364144553e35a9912d958749e1 Mon Sep 17 00:00:00 2001 From: Braks <78412429+bcakmakoglu@users.noreply.github.com> Date: Sun, 28 Nov 2021 10:01:23 +0100 Subject: [PATCH] fix(store): zoom related state to update when flow is ready Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com> --- src/container/ZoomPane/ZoomPane.vue | 2 +- src/store/stateStore.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/container/ZoomPane/ZoomPane.vue b/src/container/ZoomPane/ZoomPane.vue index 5190b134..bd8421b1 100644 --- a/src/container/ZoomPane/ZoomPane.vue +++ b/src/container/ZoomPane/ZoomPane.vue @@ -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], diff --git a/src/store/stateStore.ts b/src/store/stateStore.ts index 396e874b..7ec031d9 100644 --- a/src/store/stateStore.ts +++ b/src/store/stateStore.ts @@ -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) + } }, }, })