mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-09 07:56:22 -06:00
Monitor Tab - Fix -1h -1m bug
Contributes to CL-1047
This commit is contained in:
parent
28324ff2f6
commit
13717d3ce6
1 changed files with 6 additions and 1 deletions
|
@ -668,7 +668,12 @@ Component
|
|||
case "queued":
|
||||
return catalog.i18nc("@label:status", "Action required")
|
||||
default:
|
||||
OutputDevice.formatDuration(modelData.activePrintJob.timeTotal - modelData.activePrintJob.timeElapsed)
|
||||
/* Sometimes total minus elapsed is less than 0. Use Math.max() to prevent
|
||||
remaining time from ever being less than 0. Negative durations cause
|
||||
strange behavior such as displaying "-1h -1m". */
|
||||
var activeJob = modelData.activePrintJob
|
||||
var remaining = activeJob.timeTotal - activeJob.timeElapsed;
|
||||
OutputDevice.formatDuration(Math.max(remaining, 0))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue