From b5dfae98356a83f4a4da6870f9f5c7ad147d7892 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 9 Mar 2026 14:10:35 +0800 Subject: [PATCH] Fix unsafe property access and stale await in DurationInput, ModalAccountInfo, FilesPage Co-Authored-By: Claude Opus 4.6 --- src/components/DurationInput.vue | 2 +- src/views/AccountManagement/ModalAccountInfo.vue | 2 +- src/views/Files/FilesPage.vue | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/components/DurationInput.vue b/src/components/DurationInput.vue index a246be9..ef03e1c 100644 --- a/src/components/DurationInput.vue +++ b/src/components/DurationInput.vue @@ -368,7 +368,7 @@ function calculateTotalSeconds() { async function createData() { const size = props.size; - if (maxTotal.value !== (await null) && minTotal.value !== (await null)) { + if (maxTotal.value !== null && minTotal.value !== null) { switch (size) { case "max": secondToDate(minTotal.value, "min"); diff --git a/src/views/AccountManagement/ModalAccountInfo.vue b/src/views/AccountManagement/ModalAccountInfo.vue index e3d4bc6..9a8212c 100644 --- a/src/views/AccountManagement/ModalAccountInfo.vue +++ b/src/views/AccountManagement/ModalAccountInfo.vue @@ -63,6 +63,6 @@ const is_active = computed(() => currentViewingUser.value.is_active); onBeforeMount(async () => { await acctMgmtStore.getUserDetail(currentViewingUser.value.username); - visitTime.value = currentViewingUser.value.detail.visits; + visitTime.value = currentViewingUser.value.detail?.visits ?? 0; }); diff --git a/src/views/Files/FilesPage.vue b/src/views/Files/FilesPage.vue index 4ff6768..e19a07a 100644 --- a/src/views/Files/FilesPage.vue +++ b/src/views/Files/FilesPage.vue @@ -823,6 +823,7 @@ function download(type, id, source, name) { * Delete Compare Primary log */ function primaryDragDelete() { + if (primaryDragData.value.length === 0) return; compareData.value.unshift(primaryDragData.value[0]); primaryDragData.value = []; } @@ -831,6 +832,7 @@ function primaryDragDelete() { * Delete Compare Secondary log */ function secondaryDragDelete() { + if (secondaryDragData.value.length === 0) return; compareData.value.unshift(secondaryDragData.value[0]); secondaryDragData.value = []; }