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:
ArtificialLab
2024-09-22 15:06:48 +04:00
committed by Chenlei Hu
parent 38c2ec7532
commit d735513e60
3 changed files with 160 additions and 168 deletions

View File

@@ -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>