Skip to content

Commit 040eaf7

Browse files
cawa-93pi0
authored andcommitted
fix(progress): handle division by zero (#117)
fixes #166.
1 parent 76333d8 commit 040eaf7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/plugin.template.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ const setupProgress = (axios, ctx) => {
137137

138138
const onProgress = e => {
139139
const progress = ((e.loaded * 100) / (e.total * currentRequests))
140-
$loading().set(progress)
140+
$loading().set(Math.min(100, progress))
141141
}
142142

143143
axios.defaults.onUploadProgress = onProgress

0 commit comments

Comments
 (0)