mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-04-26 01:09:46 +00:00
[nit] Further simplify watcher via whenever (#3790)
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
<script setup lang="ts">
|
||||
import { createBounds } from '@comfyorg/litegraph'
|
||||
import type { LGraphCanvas } from '@comfyorg/litegraph'
|
||||
import { whenever } from '@vueuse/core'
|
||||
import { ref, watch } from 'vue'
|
||||
|
||||
import { useAbsolutePosition } from '@/composables/element/useAbsolutePosition'
|
||||
@@ -62,13 +63,9 @@ watch(
|
||||
{ immediate: true }
|
||||
)
|
||||
|
||||
watch(
|
||||
whenever(
|
||||
() => canvasStore.getCanvas().ds.state,
|
||||
(state) => {
|
||||
if (!state) return
|
||||
|
||||
positionSelectionOverlay(canvasStore.getCanvas())
|
||||
},
|
||||
() => positionSelectionOverlay(canvasStore.getCanvas()),
|
||||
{ deep: true }
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user