Revert "Fix routing and layout issue (#923)" (#930)

This reverts commit 94db2e90da.
This commit is contained in:
Chenlei Hu
2024-09-23 09:00:29 +09:00
parent d735513e60
commit 4fa3a38f98
3 changed files with 168 additions and 160 deletions

View File

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