diff --git a/photon-client/src/components/dashboard/tabs/TargetsTab.vue b/photon-client/src/components/dashboard/tabs/TargetsTab.vue index 1e2caf8936..f37bcc78e3 100644 --- a/photon-client/src/components/dashboard/tabs/TargetsTab.vue +++ b/photon-client/src/components/dashboard/tabs/TargetsTab.vue @@ -28,7 +28,7 @@ const calculateStdDev = (values: number[]): number => { }; const resetCurrentBuffer = () => { // Need to clear the array in place - while (useStateStore().currentMultitagBuffer?.length != 0) useStateStore().currentMultitagBuffer?.pop(); + if (useStateStore().currentMultitagBuffer) useStateStore().currentMultitagBuffer!.length = 0; }; diff --git a/photon-client/src/stores/StateStore.ts b/photon-client/src/stores/StateStore.ts index 47ec05eb82..3a7376e12b 100644 --- a/photon-client/src/stores/StateStore.ts +++ b/photon-client/src/stores/StateStore.ts @@ -84,7 +84,8 @@ export const useStateStore = defineStore("state", { return this.backendResults[this.currentCameraIndex.toString()]; }, currentMultitagBuffer(): MultitagResult[] | undefined { - return this.multitagResultBuffer[this.currentCameraIndex.toString()]; + if (!this.multitagResultBuffer[this.currentCameraIndex]) this.multitagResultBuffer[this.currentCameraIndex] = []; + return this.multitagResultBuffer[this.currentCameraIndex]; } }, actions: {