mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-23 08:14:06 +00:00
This reverts commit 94db2e90da.
This commit is contained in:
@@ -1,20 +1,16 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--
|
||||
UnloadWindowConfirmDialog: This component does not render
|
||||
anything visible. It is used to confirm the user wants to
|
||||
close the window, and if they do, it will call the
|
||||
beforeunload event.
|
||||
-->
|
||||
<!-- This component does not render anything visible. It is used to confirm
|
||||
the user wants to close the window, and if they do, it will call the
|
||||
beforeunload event. -->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
import { onMounted, onBeforeUnmount } from 'vue'
|
||||
import { onMounted, onUnmounted } from 'vue'
|
||||
|
||||
const settingStore = useSettingStore()
|
||||
|
||||
const handleBeforeUnload = (event: BeforeUnloadEvent) => {
|
||||
if (settingStore.get('Comfy.Window.UnloadConfirmation')) {
|
||||
event.preventDefault()
|
||||
@@ -27,7 +23,7 @@ onMounted(() => {
|
||||
window.addEventListener('beforeunload', handleBeforeUnload)
|
||||
})
|
||||
|
||||
onBeforeUnmount(() => {
|
||||
onUnmounted(() => {
|
||||
window.removeEventListener('beforeunload', handleBeforeUnload)
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user