forked from vergnet/application-amicale
Fixed modal displaying negative remaining times
This commit is contained in:
parent
ea16a1f50f
commit
9e4e340302
1 changed files with 5 additions and 1 deletions
|
@ -267,6 +267,10 @@ class ProxiwashScreen extends React.Component<Props, State> {
|
||||||
let message = modalStateStrings[ProxiwashConstants.machineStates[item.state]];
|
let message = modalStateStrings[ProxiwashConstants.machineStates[item.state]];
|
||||||
const onPress = this.onSetupNotificationsPress.bind(this, item);
|
const onPress = this.onSetupNotificationsPress.bind(this, item);
|
||||||
if (ProxiwashConstants.machineStates[item.state] === ProxiwashConstants.machineStates["EN COURS"]) {
|
if (ProxiwashConstants.machineStates[item.state] === ProxiwashConstants.machineStates["EN COURS"]) {
|
||||||
|
let remainingTime = parseInt(item.remainingTime)
|
||||||
|
if (remainingTime < 0)
|
||||||
|
remainingTime = 0;
|
||||||
|
|
||||||
button =
|
button =
|
||||||
{
|
{
|
||||||
text: isMachineWatched(item, this.state.machinesWatched) ?
|
text: isMachineWatched(item, this.state.machinesWatched) ?
|
||||||
|
@ -280,7 +284,7 @@ class ProxiwashScreen extends React.Component<Props, State> {
|
||||||
{
|
{
|
||||||
start: item.startTime,
|
start: item.startTime,
|
||||||
end: item.endTime,
|
end: item.endTime,
|
||||||
remaining: item.remainingTime
|
remaining: remainingTime
|
||||||
});
|
});
|
||||||
} else if (ProxiwashConstants.machineStates[item.state] === ProxiwashConstants.machineStates.DISPONIBLE) {
|
} else if (ProxiwashConstants.machineStates[item.state] === ProxiwashConstants.machineStates.DISPONIBLE) {
|
||||||
if (isDryer)
|
if (isDryer)
|
||||||
|
|
Loading…
Reference in a new issue