summaryrefslogtreecommitdiff
path: root/app/client/api/crud.upload.js
diff options
context:
space:
mode:
authorJules Laplace <julescarbon@gmail.com>2018-05-29 19:27:20 +0200
committerJules Laplace <julescarbon@gmail.com>2018-05-29 19:27:20 +0200
commit24135cf037085f2ae7d70e48f023614435e29b3f (patch)
tree50e4532300cfa990f37c945bb88c15b34104f569 /app/client/api/crud.upload.js
parentfe8cef1b709f09f508f17d0d6d06f204dd44a8bb (diff)
le file list
Diffstat (limited to 'app/client/api/crud.upload.js')
-rw-r--r--app/client/api/crud.upload.js19
1 files changed, 14 insertions, 5 deletions
diff --git a/app/client/api/crud.upload.js b/app/client/api/crud.upload.js
index 2e0269a..65ae4e0 100644
--- a/app/client/api/crud.upload.js
+++ b/app/client/api/crud.upload.js
@@ -24,11 +24,20 @@ export function crud_upload(type, fd, data, dispatch) {
function uploadProgress (e) {
if (e.lengthComputable) {
- dispatch && dispatch({
- type: as_type(type, 'upload_progress'),
- percent: Math.round(e.loaded * 100 / e.total) || 0,
- [type]: id,
- })
+ const percent = Math.round(e.loaded * 100 / e.total) || 0
+ if (percent > 99) {
+ dispatch && dispatch({
+ type: as_type(type, 'upload_waiting'),
+ percent,
+ [type]: id,
+ })
+ } else {
+ dispatch && dispatch({
+ type: as_type(type, 'upload_progress'),
+ percent,
+ [type]: id,
+ })
+ }
}
else {
dispatch && dispatch({