fix: avoid hitting 100% before print is complete (#1455)
This commit is contained in:
1 parent
ef2d17cadd
commit
39590004da
4 files changed
+4
-4
No files matched your search
+1
-1
@@ -170,7 +170,7 @@ export default class App extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get print_percent(): number {
|
||||
return Math.round(this.$store.getters['printer/getPrintPercent'] * 100)
|
||||
return Math.floor(this.$store.getters['printer/getPrintPercent'] * 100)
|
||||
}
|
||||
|
||||
@Watch('language')
|
||||
|
||||
@@ -185,7 +185,7 @@ export default class StatusPanel extends Mixins(BaseMixin) {
|
||||
}
|
||||
|
||||
get printPercent() {
|
||||
return Math.round(this.$store.getters['printer/getPrintPercent'] * 100)
|
||||
return Math.floor(this.$store.getters['printer/getPrintPercent'] * 100)
|
||||
}
|
||||
|
||||
get printerStateOutput() {
|
||||
|
||||
@@ -52,7 +52,7 @@ export const getters: GetterTree<FarmPrinterState, any> = {
|
||||
if (state.data.print_stats.state === 'printing') {
|
||||
const percent = getters['getPrintPercent']
|
||||
|
||||
return Math.round(percent * 100) + '% Printing'
|
||||
return Math.floor(percent * 100) + '% Printing'
|
||||
}
|
||||
|
||||
return state.data.print_stats.state.charAt(0).toUpperCase() + state.data.print_stats.state.slice(1)
|
||||
|
||||
@@ -38,7 +38,7 @@ export const getters: GetterTree<RootState, any> = {
|
||||
// return printing title
|
||||
if (printer_state === 'printing') {
|
||||
const eta = getters['printer/getEstimatedTimeETAFormat']
|
||||
const percent = (getters['printer/getPrintPercent'] * 100).toFixed(0)
|
||||
const percent = Math.floor(getters['printer/getPrintPercent'] * 100)
|
||||
|
||||
if (eta !== '--') {
|
||||
let output = i18n.t('App.Titles.PrintingETA', {
|
||||
|
||||
Reference in new issue
Block a user