fix(core): use noop viewport operations instead of waiting for promise
This commit is contained in:
@@ -36,14 +36,7 @@ export function useViewport(state: State, getters: ComputedGetters) {
|
||||
nodesInitialized.value = true
|
||||
})
|
||||
|
||||
const isReady = computed(
|
||||
() =>
|
||||
!!d3Zoom &&
|
||||
!!d3Selection &&
|
||||
!!dimensions.width &&
|
||||
!!dimensions.height &&
|
||||
(getNodes.value.length ? nodesInitialized.value : true),
|
||||
)
|
||||
const isReady = computed(() => !!d3Zoom && !!d3Selection && !!dimensions.width && !!dimensions.height && nodesInitialized.value)
|
||||
|
||||
function zoom(scale: number, duration?: number) {
|
||||
if (d3Selection && d3Zoom) {
|
||||
|
||||
@@ -39,13 +39,6 @@ export class Storage {
|
||||
|
||||
const reactiveState = reactive(state)
|
||||
|
||||
const nodeIds = computed(() => reactiveState.nodes.map((n) => n.id))
|
||||
const edgeIds = computed(() => reactiveState.edges.map((e) => e.id))
|
||||
|
||||
const getters = useGetters(reactiveState, nodeIds, edgeIds)
|
||||
|
||||
const actions = useActions(reactiveState, getters, nodeIds, edgeIds)
|
||||
|
||||
const hooksOn = <any>{}
|
||||
Object.entries(reactiveState.hooks).forEach(([n, h]) => {
|
||||
const name = `on${n.charAt(0).toUpperCase() + n.slice(1)}`
|
||||
@@ -57,6 +50,13 @@ export class Storage {
|
||||
emits[n] = h.trigger
|
||||
})
|
||||
|
||||
const nodeIds = computed(() => reactiveState.nodes.map((n) => n.id))
|
||||
const edgeIds = computed(() => reactiveState.edges.map((e) => e.id))
|
||||
|
||||
const getters = useGetters(reactiveState, nodeIds, edgeIds)
|
||||
|
||||
const actions = useActions(id, emits, hooksOn, reactiveState, getters, nodeIds, edgeIds)
|
||||
|
||||
actions.setState(reactiveState)
|
||||
|
||||
const flow: VueFlowStore = {
|
||||
|
||||
Reference in New Issue
Block a user