Skip to content

Commit

Permalink
Merge pull request bigbluebutton#17512 from Scroody/I-17464
Browse files Browse the repository at this point in the history
Fix: Presentation un-minimizing when exiting external video or screen sharing.
  • Loading branch information
ramonlsouza committed Apr 17, 2023
2 parents 1c52b83 + 5b0bc16 commit ae83dd3
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import PropTypes from 'prop-types';
import { defineMessages, injectIntl } from 'react-intl';
import Button from '/imports/ui/components/common/button/component';


const propTypes = {
intl: PropTypes.shape({
formatMessage: PropTypes.func.isRequired,
Expand Down Expand Up @@ -47,7 +48,8 @@ const PresentationOptionsContainer = ({
buttonType = 'desktop';
}

const isThereCurrentPresentation = hasExternalVideo || hasScreenshare || hasPresentation || hasPinnedSharedNotes;
const isThereCurrentPresentation = hasExternalVideo || hasScreenshare
|| hasPresentation || hasPinnedSharedNotes;
return (
<Button
icon={`${buttonType}${!presentationIsOpen ? '_off' : ''}`}
Expand All @@ -59,7 +61,12 @@ const PresentationOptionsContainer = ({
hideLabel
circle
size="lg"
onClick={() => setPresentationIsOpen(layoutContextDispatch, !presentationIsOpen)}
onClick={() => {
setPresentationIsOpen(layoutContextDispatch, !presentationIsOpen);
if (!hasExternalVideo && !hasScreenshare && !hasPinnedSharedNotes) {
Session.set('presentationLastState', !presentationIsOpen);
}
}}
id="restore-presentation"
ghost={!presentationIsOpen}
disabled={!isThereCurrentPresentation}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,10 @@ class VideoPlayer extends Component {
type: ACTIONS.SET_HAS_EXTERNAL_VIDEO,
value: false,
});
layoutContextDispatch({
type: ACTIONS.SET_PRESENTATION_IS_OPEN,
value: Session.get('presentationLastState'),
});

if (hidePresentationOnJoin) {
layoutContextDispatch({
Expand Down
4 changes: 4 additions & 0 deletions bigbluebutton-html5/imports/ui/components/notes/component.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,10 @@ const Notes = ({
type: ACTIONS.SET_NOTES_IS_PINNED,
value: false,
});
layoutContextDispatch({
type: ACTIONS.SET_PRESENTATION_IS_OPEN,
value: Session.get('presentationLastState'),
});
};
}
}, []);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,10 @@ class ScreenshareComponent extends React.Component {
}

this.clearMediaFlowingMonitor();
layoutContextDispatch({
type: ACTIONS.SET_PRESENTATION_IS_OPEN,
value: Session.get('presentationLastState'),
});
}

clearMediaFlowingMonitor() {
Expand Down

0 comments on commit ae83dd3

Please sign in to comment.