From ed2b2dd685d4c6f474d580bc5c3d7267ae5c8dd0 Mon Sep 17 00:00:00 2001 From: Lars Saalbach Date: Tue, 7 May 2024 18:30:24 +0200 Subject: [PATCH] Retrieve old weight, if the weight is to high. --- .../brew-brewing-graph/brew-brewing-graph.component.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/brews/brew-brewing-graph/brew-brewing-graph.component.ts b/src/components/brews/brew-brewing-graph/brew-brewing-graph.component.ts index 49678dd0..2bef13f3 100644 --- a/src/components/brews/brew-brewing-graph/brew-brewing-graph.component.ts +++ b/src/components/brews/brew-brewing-graph/brew-brewing-graph.component.ts @@ -2902,7 +2902,12 @@ export class BrewBrewingGraphComponent implements OnInit { if (scaleType === ScaleType.LUNAR) { if (weight > 5000) { // Wrong scale values reported. - Fix it back - weight = oldWeight; + if (this.flowProfileTempAll.length > 0) { + const lastEntry = this.flowProfileTempAll.slice(-1); + weight = lastEntry[0].weight; + } else { + weight = oldWeight; + } } else { if (weight <= 0) { if (this.flowProfileTempAll.length >= 3) {