Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Download presentation popup window is broken #19734

Merged
merged 1 commit into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ class Presentation extends PureComponent {
numPages,
currentPresentationId,
fitToWidth,
downloadPresentationUri,
} = this.props;
const {
presentationWidth,
Expand Down Expand Up @@ -258,8 +259,9 @@ class Presentation extends PureComponent {
);

if (
prevProps?.currentPresentation?.id !== currentPresentation.id ||
(downloadableOn && !userIsPresenter)
prevProps?.currentPresentation?.id !== currentPresentation.id
|| prevProps?.downloadPresentationUri !== downloadPresentationUri
|| (downloadableOn && !userIsPresenter)
) {
if (this.currentPresentationToastId) {
toast.update(this.currentPresentationToastId, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,10 +117,15 @@ export default lockContextContainer(
}
}
const currentPresentation = PresentationService.getCurrentPresentation(podId);

const downloadPresentationUri = currentPresentation
? `${APP_CONFIG.bbbWebBase}/${currentPresentation?.originalFileURI}`
: null;

return {
currentSlide,
slidePosition,
downloadPresentationUri: PresentationService.downloadPresentationUri(podId),
downloadPresentationUri,
multiUser:
(WhiteboardService.hasMultiUserAccess(currentSlide && currentSlide.id, Auth.userID)
|| WhiteboardService.isMultiUserActive(currentSlide?.id)
Expand Down
12 changes: 0 additions & 12 deletions bigbluebutton-html5/imports/ui/components/presentation/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,12 @@ import { safeMatch } from '/imports/utils/string-utils';
const POLL_SETTINGS = Meteor.settings.public.poll;
const MAX_CUSTOM_FIELDS = POLL_SETTINGS.maxCustom;
const MAX_CHAR_LIMIT = POLL_SETTINGS.maxTypedAnswerLength;
const APP = Meteor.settings.public.app;

const getCurrentPresentation = (podId) => Presentations.findOne({
podId,
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 currentPresentation = getCurrentPresentation(podId);
if (!currentPresentation) {
Expand Down Expand Up @@ -248,7 +237,6 @@ export default {
getCurrentSlide,
getSlidePosition,
isPresentationDownloadable,
downloadPresentationUri,
currentSlidHasContent,
parseCurrentSlideContent,
getCurrentPresentation,
Expand Down