File tree Expand file tree Collapse file tree 1 file changed +11
-9
lines changed
Expand file tree Collapse file tree 1 file changed +11
-9
lines changed Original file line number Diff line number Diff line change 2121<script setup lang="ts">
2222import { whenever } from ' @vueuse/core'
2323import Button from ' primevue/button'
24+ import { computed } from ' vue'
2425
2526import NodeHelpContent from ' @/components/node/NodeHelpContent.vue'
2627import { useSelectionState } from ' @/composables/graph/useSelectionState'
@@ -36,14 +37,15 @@ defineEmits<{
3637const nodeHelpStore = useNodeHelpStore ()
3738const { nodeDef } = useSelectionState ()
3839
39- // Keep the open help page synced with the current selection while help is open.
40- whenever (
41- () => (nodeHelpStore .isHelpOpen ? nodeDef .value : null ),
42- (def ) => {
43- if (! def ) return
44- const currentHelpNode = nodeHelpStore .currentHelpNode
45- if (currentHelpNode ?.nodePath === def .nodePath ) return
46- nodeHelpStore .openHelp (def )
47- }
40+ const activeHelpDef = computed (() =>
41+ nodeHelpStore .isHelpOpen ? nodeDef .value : null
4842)
43+
44+ // Keep the open help page synced with the current selection while help is open.
45+ whenever (activeHelpDef , (def ) => {
46+ if (! def ) return
47+ const currentHelpNode = nodeHelpStore .currentHelpNode
48+ if (currentHelpNode ?.nodePath === def .nodePath ) return
49+ nodeHelpStore .openHelp (def )
50+ })
4951 </script >
You can’t perform that action at this time.
0 commit comments