Skip to content

Commit

Permalink
fix(progress): handle division by zero (#117)
Browse files Browse the repository at this point in the history
fixes #166.
  • Loading branch information
cawa-93 authored and pi0 committed Mar 6, 2018
1 parent 76333d8 commit 040eaf7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/plugin.template.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ const setupProgress = (axios, ctx) => {

const onProgress = e => {
const progress = ((e.loaded * 100) / (e.total * currentRequests))
$loading().set(progress)
$loading().set(Math.min(100, progress))
}

axios.defaults.onUploadProgress = onProgress
Expand Down

0 comments on commit 040eaf7

Please sign in to comment.