From 00d7f02ca0b21081481d5e340315fe0abf4c85e3 Mon Sep 17 00:00:00 2001 From: Neko Ayaka Date: Tue, 10 Mar 2026 01:04:54 +0800 Subject: [PATCH] fix(stage-tamagotchi): hearing dialog will cause controls island collapse --- .../stage-islands/controls-island/index.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/stage-tamagotchi/src/renderer/components/stage-islands/controls-island/index.vue b/apps/stage-tamagotchi/src/renderer/components/stage-islands/controls-island/index.vue index 6e957bef2..324f876cc 100644 --- a/apps/stage-tamagotchi/src/renderer/components/stage-islands/controls-island/index.vue +++ b/apps/stage-tamagotchi/src/renderer/components/stage-islands/controls-island/index.vue @@ -40,17 +40,21 @@ const setAlwaysOnTop = useElectronEventaInvoke(electronWindowSetAlwaysOnTop) const expanded = ref(false) const islandRef = ref() +// Expose whether hearing dialog is open so parent can disable click-through +const hearingDialogOpen = ref(false) +defineExpose({ hearingDialogOpen }) + const { isOutside } = useElectronMouseInElement(islandRef) const isOutsideAfter2seconds = refDebounced(isOutside, 1500) watch(isOutsideAfter2seconds, (outside) => { - if (outside && expanded.value) { + if (outside && expanded.value && !hearingDialogOpen.value) { expanded.value = false } }) useIntervalFn(() => { - if (expanded.value && isOutside.value) { + if (expanded.value && isOutside.value && !hearingDialogOpen.value) { expanded.value = false } }, 1500) @@ -98,10 +102,6 @@ const adjustStyleClasses = computed(() => { */ const startDraggingWindow = !isLinux() ? defineInvoke(context.value, electronStartDraggingWindow) : undefined -// Expose whether hearing dialog is open so parent can disable click-through -const hearingDialogOpen = ref(false) -defineExpose({ hearingDialogOpen }) - function refreshWindow() { window.location.reload() }