Merge pull request #20633 from JoVictorNunes/issue-20611

fix: inconsistencies in presentation upload toast
This commit is contained in:
Ramón Souza 2024-07-10 17:38:08 -03:00 committed by GitHub
commit e8a796379d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 7 additions and 12 deletions

View File

@ -220,6 +220,7 @@ trait MakePresentationDownloadReqMsgHdlr extends RightsManagementTrait {
log.error(s"No presentation set in meeting ${meetingId}")
pres = pres.copy(errorMsgKey = "204")
bus.outGW.send(buildBroadcastPresentationConversionUpdateEvtMsg(parentMeetingId, "204", jobId, filename, presentationUploadToken))
PresPresentationDAO.updateConversionStarted(parentMeetingId, pres)
} else {
val allPages: Boolean = m.allPages
val pageCount = currentPres.get.pages.size

View File

@ -7,8 +7,6 @@ import usePreviousValue from '/imports/ui/hooks/usePreviousValue';
import { notify } from '/imports/ui/services/notification';
import Session from '/imports/ui/services/storage/in-memory';
const TIMEOUT_CLOSE_TOAST = 1; // second
const EXPORT_STATUSES = {
RUNNING: 'RUNNING',
COLLECTING: 'COLLECTING',
@ -435,12 +433,8 @@ function renderExportToast(presToShow, intl) {
export const PresentationUploaderToast = ({
intl,
convertingPresentations,
uploadingPresentations,
presentations,
}) => {
const presentationsToConvert = convertingPresentations
.concat(uploadingPresentations)
.filter((p) => p);
const prevPresentations = usePreviousValue(presentations);
useEffect(() => {
@ -486,24 +480,25 @@ export const PresentationUploaderToast = ({
}, [presentations]);
let activeToast = Session.getItem('presentationUploaderToastId');
const presentationsToConvertFiltered = presentationsToConvert.filter((p) => p);
const showToast = presentationsToConvertFiltered.length > 0;
const showToast = convertingPresentations.length > 0;
if (showToast && !activeToast) {
activeToast = toast.info(() => renderToastList(presentationsToConvertFiltered, intl), {
activeToast = toast.info(() => renderToastList(convertingPresentations, intl), {
hideProgressBar: true,
autoClose: false,
newestOnTop: true,
closeOnClick: true,
className: 'presentationUploaderToast toastClass',
onClose: () => {
Session.setItem('presentationUploaderToastId', null);
},
});
Session.setItem('presentationUploaderToastId', activeToast);
} else if (!showToast && activeToast) {
handleDismissToast(activeToast);
Session.setItem('presentationUploaderToastId', null);
} else {
toast.update(activeToast, {
render: renderToastList(presentationsToConvertFiltered, intl),
render: renderToastList(convertingPresentations, intl),
});
}
return null;

View File

@ -477,7 +477,6 @@ class PresentationUploader extends Component {
const id = Session.getItem('presentationUploaderToastId');
if (id) {
toast.dismiss(id);
Session.setItem('presentationUploaderToastId', null);
}
Session.setItem('showUploadPresentationView', false);
}