fix: skip dimensions check when ssr

Signed-off-by: Braks <78412429+bcakmakoglu@users.noreply.github.com>
This commit is contained in:
Braks
2021-11-21 18:48:24 +01:00
parent f64ae24ee2
commit 3e4433c175
2 changed files with 9 additions and 10 deletions
+3 -2
View File
@@ -3,7 +3,7 @@ import { D3ZoomEvent, zoom, zoomIdentity, ZoomTransform } from 'd3-zoom'
import { get, invoke } from '@vueuse/core'
import { pointer, select } from 'd3-selection'
import { FlowTransform, KeyCode, PanOnScrollMode } from '../../types'
import { useKeyPress, useStore } from '../../composables'
import { useKeyPress, useStore, useWindow } from '../../composables'
import { clamp } from '../../utils'
interface ZoomPaneProps {
@@ -182,7 +182,8 @@ store.dimensions = {
}
// skip waiting for ssr
if (typeof window !== 'undefined') await until(() => store.isReady).toMatch((y) => y)
const window = useWindow()
if ('screen' in window) await until(() => store.isReady).toMatch((y) => y)
watch(
[width, height],