Fix sort() mutating state in getter by copying array first
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user