Merge pull request #12565 from ramonlsouza/fix-presentation-upload
fix: check for presenter status at presentation upload modal
This commit is contained in:
commit
6b2e070786
@ -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);
|
||||
|
@ -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>
|
||||
)
|
||||
);
|
||||
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user