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() }