Skip to content

Commit

Permalink
Address review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vitvakatu committed May 16, 2024
1 parent d2dc27a commit 72b4609
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions app/gui2/src/components/GraphEditor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,16 @@ useNavigatorStorage(
waitInitializationAndPanToAll,
)
const stopInitialization = ref<() => void>()
let stopInitialization: (() => void) | undefined
function waitInitializationAndPanToAll() {
stopInitialization.value?.()
stopInitialization.value = watchEffect(() => {
const nodesCount = [...graphStore.db.nodeIdToNode.keys()].length
stopInitialization?.()
stopInitialization = watchEffect(() => {
const nodesCount = graphStore.db.nodeIdToNode.size
const visibleNodeAreas = graphStore.visibleNodeAreas
if (nodesCount > 0 && visibleNodeAreas.length == nodesCount) {
zoomToSelected(true)
stopInitialization.value?.()
stopInitialization?.()
stopInitialization = undefined
}
})
}
Expand Down

0 comments on commit 72b4609

Please sign in to comment.