Skip to content

Commit 33ff161

Browse files
fix(brew-complete-screen): handle nan values for last brew weight
1 parent e587a6e commit 33ff161

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/BrewCompleteScreen/BrewCompleteScreen.tsx

+4-3
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,11 @@ export const BrewCompleteScreen = () => {
6868
notificationSelector.selectHasNotifications
6969
);
7070

71-
const weight =
72-
Math.abs(lastBrewWeight) < 1000
71+
const weight = !isNaN(lastBrewWeight)
72+
? Math.abs(lastBrewWeight) < 1000
7373
? lastBrewWeight.toFixed(1)
74-
: lastBrewWeight.toFixed(0);
74+
: lastBrewWeight.toFixed(0)
75+
: lastBrewWeight;
7576

7677
const isPurging = statsName === 'purge';
7778

0 commit comments

Comments
 (0)