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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user