mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-02-27 10:14:06 +00:00
Fix routing and layout issue (#923)
* fix router and move graph related parts to GraphView.vue * (fix) add back child element in UnloadWindowConfirmDialog * (cleanup) remove empty callback
This commit is contained in:
committed by
Chenlei Hu
parent
38c2ec7532
commit
d735513e60
@@ -1,16 +1,20 @@
|
||||
<template>
|
||||
<div>
|
||||
<!-- 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. -->
|
||||
<!--
|
||||
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.
|
||||
-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { useSettingStore } from '@/stores/settingStore'
|
||||
import { onMounted, onUnmounted } from 'vue'
|
||||
import { onMounted, onBeforeUnmount } from 'vue'
|
||||
|
||||
const settingStore = useSettingStore()
|
||||
|
||||
const handleBeforeUnload = (event: BeforeUnloadEvent) => {
|
||||
if (settingStore.get('Comfy.Window.UnloadConfirmation')) {
|
||||
event.preventDefault()
|
||||
@@ -23,7 +27,7 @@ onMounted(() => {
|
||||
window.addEventListener('beforeunload', handleBeforeUnload)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
onBeforeUnmount(() => {
|
||||
window.removeEventListener('beforeunload', handleBeforeUnload)
|
||||
})
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user