[apply-toast-shared-notes] - fix shared-notes display wrong information when clicking the confirm button
This commit is contained in:
parent
5cb34e7917
commit
9495e9ae01
@ -13,7 +13,7 @@ export default function setPresentationDownloadable(presentationId, downloadable
|
||||
|
||||
check(meetingId, String);
|
||||
check(requesterUserId, String);
|
||||
check(downloadable, Boolean);
|
||||
check(downloadable, Match.Maybe(Boolean));
|
||||
check(presentationId, String);
|
||||
|
||||
const payload = {
|
||||
|
@ -11,7 +11,7 @@ async function convertAndUpload() {
|
||||
|
||||
let filename = 'Shared_Notes';
|
||||
const presentations = PresentationUploaderService.getPresentations();
|
||||
const duplicates = presentations.filter((pres) => pres.filename.startsWith(filename)).length;
|
||||
const duplicates = presentations.filter((pres) => pres.filename?.startsWith(filename) || pres.name?.startsWith(filename)).length;
|
||||
|
||||
if (duplicates !== 0) { filename = `${filename}(${duplicates})`; }
|
||||
|
||||
|
@ -255,7 +255,7 @@ const renderToastList = (presentations, intl) => {
|
||||
}
|
||||
|
||||
return (
|
||||
<Styled.ToastWrapper>
|
||||
<Styled.ToastWrapper data-test="presentationUploadProgressToast" >
|
||||
<Styled.UploadToastHeader>
|
||||
<Styled.UploadIcon iconName="upload" />
|
||||
<Styled.UploadToastTitle>{toastHeading}</Styled.UploadToastTitle>
|
||||
|
@ -329,6 +329,14 @@ class PresentationUploader extends Component {
|
||||
const { presentations: prevPropPresentations } = prevProps;
|
||||
|
||||
let shouldUpdateState = isOpen && !prevProps.isOpen;
|
||||
|
||||
propPresentations.forEach(p => {
|
||||
const indexOfPres = presentations.findIndex(pres => pres.temporaryPresentationId === p.temporaryPresentationId || pres.filename === p.filename);
|
||||
if (indexOfPres === -1 && p.renderedInToast !== undefined && !p.renderedInToast) {
|
||||
shouldUpdateState = true;
|
||||
}
|
||||
})
|
||||
|
||||
const presState = Object.values({
|
||||
...propPresentations,
|
||||
...presentations,
|
||||
|
@ -49,6 +49,8 @@ const getPresentations = () => Presentations
|
||||
current,
|
||||
downloadable,
|
||||
removable,
|
||||
renderedInToast,
|
||||
temporaryPresentationId,
|
||||
id,
|
||||
name,
|
||||
exportation,
|
||||
@ -59,6 +61,8 @@ const getPresentations = () => Presentations
|
||||
return {
|
||||
id,
|
||||
filename: name,
|
||||
renderedInToast,
|
||||
temporaryPresentationId,
|
||||
isCurrent: current || false,
|
||||
upload: { done: true, error: false },
|
||||
isDownloadable: downloadable,
|
||||
|
Loading…
Reference in New Issue
Block a user