fix(progress): onProgress when currentRequests is zero (#118)

master
Alex Kozack 2018-03-07 12:56:09 +02:00 committed by Pooya Parsa
parent 20f17aa031
commit a90236edd0
1 changed files with 3 additions and 0 deletions

View File

@ -136,6 +136,9 @@ const setupProgress = (axios, ctx) => {
})
const onProgress = e => {
if (!currentRequests) {
return
}
const progress = ((e.loaded * 100) / (e.total * currentRequests))
$loading().set(Math.min(100, progress))
}