Add optional chaining for file.parent access across 5 files

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 14:19:50 +08:00
parent a8984a5de5
commit 4f660ff08c
5 changed files with 12 additions and 11 deletions

View File

@@ -184,6 +184,7 @@ function getPercentLabel(val) {
/** Transforms raw stats into display-ready format with localized numbers and time labels. */
function getStatData() {
if (!stats.value) return;
statData.value = {
cases: {
count: stats.value.cases.count.toLocaleString("en-US"),
@@ -225,10 +226,10 @@ onMounted(async () => {
switch (params.type) {
case "log":
logId.value = isCheckPage ? file.parent.id : params.fileId;
logId.value = isCheckPage ? file.parent?.id : params.fileId;
break;
case "filter":
createFilterId.value = isCheckPage ? file.parent.id : params.fileId;
createFilterId.value = isCheckPage ? file.parent?.id : params.fileId;
break;
}
await allMapDataStore.getAllMapData();