Merge pull request #20633 from JoVictorNunes/issue-20611
fix: inconsistencies in presentation upload toast
This commit is contained in:
commit
e8a796379d
@ -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
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user