diff --git a/web/src/store-modules/measurement.ts b/web/src/store-modules/measurement.ts index 6058e4a..13b9260 100644 --- a/web/src/store-modules/measurement.ts +++ b/web/src/store-modules/measurement.ts @@ -54,7 +54,7 @@ export class MeasurementStoreModule extends VuexModule { const newMeasurements = existing.slice(); const index = findIndex(existing, { id: measurement.id }); - if (index > 0) { newMeasurements.push(measurement); } + if (index < 0) { newMeasurements.push(measurement); } else { newMeasurements[index] = measurement; } this.measurements = assign({}, this.measurements, { [measure.id]: newMeasurements }); }