It works now :D

This commit is contained in:
yuanhau 2025-05-14 22:10:31 +08:00
parent 861c6b8e35
commit e4d2b4840a
3 changed files with 12 additions and 3 deletions

View file

@ -248,7 +248,11 @@ onMounted(() => {
})
const openWindow = (windowName?: string) => {
if (windowName === "leave") {
router.push(localePath("/home"));
if (confirm("Are you sure?")) {
router.push(localePath("/home"));
} else {
return
}
} else {
if (windowName) findAndOpenWindow(windowName);
}
@ -340,10 +344,13 @@ const obtainTopWindowPosition = (windowId: string) => {
}
};
const closeWindow = (windowId: string) => {
const closeWindow = (windowId: string, windowAID: string) => {
activeWindows.value = activeWindows.value.filter(
(window) => window.id !== windowId,
);
currentNavBar.value = currentNavBar.value.filter(
(window) => window.windowAssociated !== windowAID
)
console.log("activeWindows.value", activeWindows.value);
};
@ -508,7 +515,7 @@ watchEffect((cleanupFn) => {
v-for="window in activeWindows"
:key="window.id"
:title="window.title"
@close="closeWindow(window.id)"
@close="closeWindow(window.id, window.absoluteId)"
@min="unMinWindow(window.id)"
:width="window.width"
:height="window.height"