From 1ac3d7cd5b43c20e7dd7579b26e1536ec75545bd 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:18 +0800 Subject: [PATCH] Fix sort() mutating state in getter by copying array first Co-Authored-By: Claude Opus 4.6 --- src/stores/allMapData.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/stores/allMapData.ts b/src/stores/allMapData.ts index 01ef5f6..0cf0e26 100644 --- a/src/stores/allMapData.ts +++ b/src/stores/allMapData.ts @@ -81,10 +81,10 @@ export const useAllMapDataStore = defineStore("allMapDataStore", { return state.allInsights; }, traces: (state) => { - return state.allTrace.sort((x, y) => x.id - y.id); + return [...state.allTrace].sort((x, y) => x.id - y.id); }, baseTraces: (state) => { - return state.allBaseTrace.sort((x, y) => x.id - y.id); + return [...state.allBaseTrace].sort((x, y) => x.id - y.id); }, cases: (state) => { return state.allCase;