fix(stage-tamagotchi): hearing dialog will cause controls island collapse
This commit is contained in:
+6
-6
@@ -40,17 +40,21 @@ const setAlwaysOnTop = useElectronEventaInvoke(electronWindowSetAlwaysOnTop)
|
||||
const expanded = ref(false)
|
||||
const islandRef = ref<HTMLElement>()
|
||||
|
||||
// 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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user