fix: fix progress above 100% with filament based calculation (#1042)

This commit is contained in:
Stefan Dej 2022-08-23 23:37:21 +02:00 committed by GitHub
parent cbb70759f5
commit 05672b55c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -87,7 +87,10 @@ export const getters: GetterTree<PrinterState, RootState> = {
if (filament_used !== null && filament_total !== null) {
if (filament_total == 0) return 0
return filament_used / filament_total
const progress = filament_used / filament_total
if (progress > 1) return 1
return progress
}
return state.virtual_sdcard?.progress ?? 0