diff options
Diffstat (limited to 'app/client/api/crud.upload.js')
| -rw-r--r-- | app/client/api/crud.upload.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/app/client/api/crud.upload.js b/app/client/api/crud.upload.js index 97b6769..2e0269a 100644 --- a/app/client/api/crud.upload.js +++ b/app/client/api/crud.upload.js @@ -20,11 +20,13 @@ export function crud_upload(type, fd, data, dispatch) { dispatch && dispatch({ type: as_type(type, 'upload_loading')}) + let complete = false + function uploadProgress (e) { if (e.lengthComputable) { dispatch && dispatch({ type: as_type(type, 'upload_progress'), - percent: Math.round(e.loaded * 100 / e.total), + percent: Math.round(e.loaded * 100 / e.total) || 0, [type]: id, }) } |
