mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 06:45:57 +08:00
Monitor Tab - Fix -1h -1m bug
Contributes to CL-1047
This commit is contained in:
parent
28324ff2f6
commit
13717d3ce6
@ -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…
x
Reference in New Issue
Block a user