File upload is done at 100
This commit is contained in:
@@ -33,7 +33,7 @@ const ModalProgressBar = ({ onCancel, uploading, progress, status }) => {
|
||||
{status && <p>{status}</p>}
|
||||
<LinearProgress variant="determinate" value={progress} />
|
||||
<Button onClick={onClickCancel}>
|
||||
{ progress < 101 ? "Cancel" : "Done" }
|
||||
{ progress < 100 ? "Cancel" : "Done" }
|
||||
</Button>
|
||||
</div>
|
||||
</Modal>
|
||||
|
||||
@@ -20,7 +20,7 @@ export const uploadFile = (file, onProgress, cancelToken) => {
|
||||
options = {
|
||||
...options,
|
||||
onUploadProgress: (event) => {
|
||||
onProgress(Math.floor((event.loaded / event.total) * 100));
|
||||
onProgress(Math.min(99, Math.floor((event.loaded / event.total) * 100)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user