Merge pull request #12565 from ramonlsouza/fix-presentation-upload

fix: check for presenter status at presentation upload modal
This commit is contained in:
Anton Georgiev 2021-06-14 17:01:29 -04:00 committed by GitHub
commit 6b2e070786
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 16 deletions

View File

@ -295,6 +295,10 @@ class PresentationUploader extends Component {
}
}
componentWillUnmount() {
Session.set('showUploadPresentationView', false);
}
isDefault(presentation) {
const { defaultFileName } = this.props;
return presentation.filename === defaultFileName
@ -312,8 +316,8 @@ class PresentationUploader extends Component {
const validExtentions = fileValidMimeTypes.map((fileValid) => fileValid.extension);
const [accepted, rejected] = _.partition(files
.concat(files2), (f) => (
validMimes.includes(f.type) || validExtentions.includes(`.${f.name.split('.').pop()}`)
));
validMimes.includes(f.type) || validExtentions.includes(`.${f.name.split('.').pop()}`)
));
const presentationsToUpload = accepted.map((file) => {
const id = _.uniqueId(file.name);

View File

@ -12,9 +12,9 @@ const PRESENTATION_CONFIG = Meteor.settings.public.presentation;
const PresentationUploaderContainer = (props) => (
props.isPresenter
&& (
<ErrorBoundary Fallback={() => <FallbackModal />}>
<PresentationUploader {...props} />
</ErrorBoundary>
<ErrorBoundary Fallback={() => <FallbackModal />}>
<PresentationUploader {...props} />
</ErrorBoundary>
)
);

View File

@ -155,17 +155,12 @@ const parseCurrentSlideContent = (yesValue, noValue, abstentionValue, trueValue,
};
const isPresenter = (podId) => {
// a main presenter in the meeting always owns a default pod
if (podId !== 'DEFAULT_PRESENTATION_POD') {
// if a pod is not default, then we check whether this user owns a current pod
const selector = {
meetingId: Auth.meetingID,
podId,
};
const pod = PresentationPods.findOne(selector);
return pod.currentPresenterId === Auth.userID;
}
return true;
const selector = {
meetingId: Auth.meetingID,
podId,
};
const pod = PresentationPods.findOne(selector);
return pod?.currentPresenterId === Auth.userID;
};
export default {