Permalink
Browse files

fix(progress): handle division by zero (#117)

fixes #166.
  • Loading branch information...
cawa-93 authored and pi0 committed Mar 6, 2018
1 parent 76333d8 commit 040eaf74109c1f5d1e7c89e99f7d959491a79701
Showing with 1 addition and 1 deletion.
  1. +1 −1 lib/plugin.template.js
@@ -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

0 comments on commit 040eaf7

Please sign in to comment.