fix incorrect state in presentation uploader

This commit is contained in:
Ramón Souza 2023-10-27 14:57:25 -03:00
parent b5b6d450c2
commit a04dedc7cf

View File

@ -284,7 +284,6 @@ const intlMessages = defineMessages({
},
});
const handleDismissToast = (id) => toast.dismiss(id);
class PresentationUploader extends Component {
@ -367,13 +366,24 @@ class PresentationUploader extends Component {
shouldUpdateState = true;
}
if (currentPropPres?.totalPagesUploaded !== prevPropPres?.totalPagesUploaded) {
modPresentation.totalPages = currentPropPres.totalPages;
if (currentPropPres?.totalPagesUploaded !== prevPropPres?.totalPagesUploaded
|| presentation.totalPagesUploaded !== currentPropPres?.totalPagesUploaded) {
modPresentation.totalPagesUploaded = currentPropPres.totalPagesUploaded;
shouldUpdateState = true;
}
if (currentPropPres?.uploadCompleted !== prevPropPres?.uploadCompleted
|| presentation.uploadCompleted !== currentPropPres?.uploadCompleted) {
modPresentation.uploadCompleted = currentPropPres.uploadCompleted;
shouldUpdateState = true;
}
if (currentPropPres?.totalPages !== prevPropPres?.totalPages
|| presentation.totalPages !== currentPropPres?.totalPages) {
modPresentation.totalPages = currentPropPres.totalPages;
shouldUpdateState = true;
}
if (currentPropPres?.downloadable !== prevPropPres?.downloadable) {
presentation.downloadable = currentPropPres.downloadable;
shouldUpdateState = true;
@ -390,7 +400,7 @@ class PresentationUploader extends Component {
}
modPresentation.uploadInProgress = currentPropPres.uploadInProgress;
modPresentation.isRemovable = currentPropPres.isRemovable;
modPresentation.removable = currentPropPres.removable;
return true;
}).filter((presentation) => {