Merge pull request #19734 from ramonlsouza/issue-19180
fix: Download presentation popup window is broken
This commit is contained in:
commit
361717c69a
@ -206,6 +206,7 @@ class Presentation extends PureComponent {
|
|||||||
numPages,
|
numPages,
|
||||||
currentPresentationId,
|
currentPresentationId,
|
||||||
fitToWidth,
|
fitToWidth,
|
||||||
|
downloadPresentationUri,
|
||||||
} = this.props;
|
} = this.props;
|
||||||
const {
|
const {
|
||||||
presentationWidth,
|
presentationWidth,
|
||||||
@ -258,8 +259,9 @@ class Presentation extends PureComponent {
|
|||||||
);
|
);
|
||||||
|
|
||||||
if (
|
if (
|
||||||
prevProps?.currentPresentation?.id !== currentPresentation.id ||
|
prevProps?.currentPresentation?.id !== currentPresentation.id
|
||||||
(downloadableOn && !userIsPresenter)
|
|| prevProps?.downloadPresentationUri !== downloadPresentationUri
|
||||||
|
|| (downloadableOn && !userIsPresenter)
|
||||||
) {
|
) {
|
||||||
if (this.currentPresentationToastId) {
|
if (this.currentPresentationToastId) {
|
||||||
toast.update(this.currentPresentationToastId, {
|
toast.update(this.currentPresentationToastId, {
|
||||||
|
@ -117,10 +117,15 @@ export default lockContextContainer(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const currentPresentation = PresentationService.getCurrentPresentation(podId);
|
const currentPresentation = PresentationService.getCurrentPresentation(podId);
|
||||||
|
|
||||||
|
const downloadPresentationUri = currentPresentation
|
||||||
|
? `${APP_CONFIG.bbbWebBase}/${currentPresentation?.originalFileURI}`
|
||||||
|
: null;
|
||||||
|
|
||||||
return {
|
return {
|
||||||
currentSlide,
|
currentSlide,
|
||||||
slidePosition,
|
slidePosition,
|
||||||
downloadPresentationUri: PresentationService.downloadPresentationUri(podId),
|
downloadPresentationUri,
|
||||||
multiUser:
|
multiUser:
|
||||||
(WhiteboardService.hasMultiUserAccess(currentSlide && currentSlide.id, Auth.userID)
|
(WhiteboardService.hasMultiUserAccess(currentSlide && currentSlide.id, Auth.userID)
|
||||||
|| WhiteboardService.isMultiUserActive(currentSlide?.id)
|
|| WhiteboardService.isMultiUserActive(currentSlide?.id)
|
||||||
|
@ -6,23 +6,12 @@ import { safeMatch } from '/imports/utils/string-utils';
|
|||||||
const POLL_SETTINGS = Meteor.settings.public.poll;
|
const POLL_SETTINGS = Meteor.settings.public.poll;
|
||||||
const MAX_CUSTOM_FIELDS = POLL_SETTINGS.maxCustom;
|
const MAX_CUSTOM_FIELDS = POLL_SETTINGS.maxCustom;
|
||||||
const MAX_CHAR_LIMIT = POLL_SETTINGS.maxTypedAnswerLength;
|
const MAX_CHAR_LIMIT = POLL_SETTINGS.maxTypedAnswerLength;
|
||||||
const APP = Meteor.settings.public.app;
|
|
||||||
|
|
||||||
const getCurrentPresentation = (podId) => Presentations.findOne({
|
const getCurrentPresentation = (podId) => Presentations.findOne({
|
||||||
podId,
|
podId,
|
||||||
current: true,
|
current: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
const downloadPresentationUri = (podId) => {
|
|
||||||
const currentPresentation = getCurrentPresentation(podId);
|
|
||||||
if (!currentPresentation) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
const { originalFileURI: uri } = currentPresentation;
|
|
||||||
return `${APP.bbbWebBase}/${uri}`;
|
|
||||||
};
|
|
||||||
|
|
||||||
const isPresentationDownloadable = (podId) => {
|
const isPresentationDownloadable = (podId) => {
|
||||||
const currentPresentation = getCurrentPresentation(podId);
|
const currentPresentation = getCurrentPresentation(podId);
|
||||||
if (!currentPresentation) {
|
if (!currentPresentation) {
|
||||||
@ -248,7 +237,6 @@ export default {
|
|||||||
getCurrentSlide,
|
getCurrentSlide,
|
||||||
getSlidePosition,
|
getSlidePosition,
|
||||||
isPresentationDownloadable,
|
isPresentationDownloadable,
|
||||||
downloadPresentationUri,
|
|
||||||
currentSlidHasContent,
|
currentSlidHasContent,
|
||||||
parseCurrentSlideContent,
|
parseCurrentSlideContent,
|
||||||
getCurrentPresentation,
|
getCurrentPresentation,
|
||||||
|
Loading…
Reference in New Issue
Block a user