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>}
|
{status && <p>{status}</p>}
|
||||||
<LinearProgress variant="determinate" value={progress} />
|
<LinearProgress variant="determinate" value={progress} />
|
||||||
<Button onClick={onClickCancel}>
|
<Button onClick={onClickCancel}>
|
||||||
{ progress < 101 ? "Cancel" : "Done" }
|
{ progress < 100 ? "Cancel" : "Done" }
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</Modal>
|
</Modal>
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export const uploadFile = (file, onProgress, cancelToken) => {
|
|||||||
options = {
|
options = {
|
||||||
...options,
|
...options,
|
||||||
onUploadProgress: (event) => {
|
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