Skip to content

Commit

Permalink
avoid hitting 100% before print is complete
Browse files Browse the repository at this point in the history
The existing implementation will report 100% from 99.5% on, due to
round(). Switching to floor() instead, which will report 99% until
complete.

Signed-off-by: Jamin W. Collins <jamin.collins@gmail.com>
  • Loading branch information
jamincollins committed Jul 7, 2023
1 parent ef2d17c commit 0ade123
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/store/farm/printer/getters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0ade123

Please sign in to comment.