Fix unsafe property access and stale await in DurationInput, ModalAccountInfo, FilesPage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 14:10:35 +08:00
parent 5f597961c6
commit b5dfae9835
3 changed files with 4 additions and 2 deletions

View File

@@ -368,7 +368,7 @@ function calculateTotalSeconds() {
async function createData() { async function createData() {
const size = props.size; const size = props.size;
if (maxTotal.value !== (await null) && minTotal.value !== (await null)) { if (maxTotal.value !== null && minTotal.value !== null) {
switch (size) { switch (size) {
case "max": case "max":
secondToDate(minTotal.value, "min"); secondToDate(minTotal.value, "min");

View File

@@ -63,6 +63,6 @@ const is_active = computed(() => currentViewingUser.value.is_active);
onBeforeMount(async () => { onBeforeMount(async () => {
await acctMgmtStore.getUserDetail(currentViewingUser.value.username); await acctMgmtStore.getUserDetail(currentViewingUser.value.username);
visitTime.value = currentViewingUser.value.detail.visits; visitTime.value = currentViewingUser.value.detail?.visits ?? 0;
}); });
</script> </script>

View File

@@ -823,6 +823,7 @@ function download(type, id, source, name) {
* Delete Compare Primary log * Delete Compare Primary log
*/ */
function primaryDragDelete() { function primaryDragDelete() {
if (primaryDragData.value.length === 0) return;
compareData.value.unshift(primaryDragData.value[0]); compareData.value.unshift(primaryDragData.value[0]);
primaryDragData.value = []; primaryDragData.value = [];
} }
@@ -831,6 +832,7 @@ function primaryDragDelete() {
* Delete Compare Secondary log * Delete Compare Secondary log
*/ */
function secondaryDragDelete() { function secondaryDragDelete() {
if (secondaryDragData.value.length === 0) return;
compareData.value.unshift(secondaryDragData.value[0]); compareData.value.unshift(secondaryDragData.value[0]);
secondaryDragData.value = []; secondaryDragData.value = [];
} }