Browse Source

Fixed modal displaying negative remaining times

Arnaud Vergnet 1 year ago
parent
commit
9e4e340302
1 changed files with 5 additions and 1 deletions
  1. 5
    1
      src/screens/Proxiwash/ProxiwashScreen.js

+ 5
- 1
src/screens/Proxiwash/ProxiwashScreen.js View File

@@ -267,6 +267,10 @@ class ProxiwashScreen extends React.Component<Props, State> {
267 267
         let message = modalStateStrings[ProxiwashConstants.machineStates[item.state]];
268 268
         const onPress = this.onSetupNotificationsPress.bind(this, item);
269 269
         if (ProxiwashConstants.machineStates[item.state] === ProxiwashConstants.machineStates["EN COURS"]) {
270
+            let remainingTime = parseInt(item.remainingTime)
271
+            if (remainingTime < 0)
272
+                remainingTime = 0;
273
+
270 274
             button =
271 275
                 {
272 276
                     text: isMachineWatched(item, this.state.machinesWatched) ?
@@ -280,7 +284,7 @@ class ProxiwashScreen extends React.Component<Props, State> {
280 284
                 {
281 285
                     start: item.startTime,
282 286
                     end: item.endTime,
283
-                    remaining: item.remainingTime
287
+                    remaining: remainingTime
284 288
                 });
285 289
         } else if (ProxiwashConstants.machineStates[item.state] === ProxiwashConstants.machineStates.DISPONIBLE) {
286 290
             if (isDryer)

Loading…
Cancel
Save