From 9e4e340302f966f7c8b655d766f092040170bc5f Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Fri, 1 May 2020 16:18:55 +0200 Subject: [PATCH] Fixed modal displaying negative remaining times --- src/screens/Proxiwash/ProxiwashScreen.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/screens/Proxiwash/ProxiwashScreen.js b/src/screens/Proxiwash/ProxiwashScreen.js index 2527c6c..1f2f3f3 100644 --- a/src/screens/Proxiwash/ProxiwashScreen.js +++ b/src/screens/Proxiwash/ProxiwashScreen.js @@ -267,6 +267,10 @@ class ProxiwashScreen extends React.Component { let message = modalStateStrings[ProxiwashConstants.machineStates[item.state]]; const onPress = this.onSetupNotificationsPress.bind(this, item); if (ProxiwashConstants.machineStates[item.state] === ProxiwashConstants.machineStates["EN COURS"]) { + let remainingTime = parseInt(item.remainingTime) + if (remainingTime < 0) + remainingTime = 0; + button = { text: isMachineWatched(item, this.state.machinesWatched) ? @@ -280,7 +284,7 @@ class ProxiwashScreen extends React.Component { { start: item.startTime, end: item.endTime, - remaining: item.remainingTime + remaining: remainingTime }); } else if (ProxiwashConstants.machineStates[item.state] === ProxiwashConstants.machineStates.DISPONIBLE) { if (isDryer)