From 88d3c411efbf5f6ac74fa67e38c154f1e53d4938 Mon Sep 17 00:00:00 2001
From: eug-vs <eug-vs@keemail.me>
Date: Fri, 14 Aug 2020 02:24:18 +0300
Subject: feat: show upload progress

---
 src/hooks/useS3Preupload.tsx | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

(limited to 'src/hooks/useS3Preupload.tsx')

diff --git a/src/hooks/useS3Preupload.tsx b/src/hooks/useS3Preupload.tsx
index aeb1d65..64db942 100644
--- a/src/hooks/useS3Preupload.tsx
+++ b/src/hooks/useS3Preupload.tsx
@@ -41,7 +41,10 @@ export default () => {
           const { config: { url } } = response;
           return url ? url.slice(0, url.indexOf('?')) : '';
         });
-    } else return url || '';
+    } else {
+      setProgress(100);
+      return url || '';
+    }
   }, [file, handleUploadProgress, url]);
 
   return { setValue, isReady, resolve, progress };
-- 
cgit v1.2.3

