Merge pull request #14097 from ramonlsouza/issue-14069
fix: Keep the state of the presentation after sharing the screen
This commit is contained in:
commit
f69b8c1a54
@ -72,6 +72,7 @@ class ScreenshareComponent extends React.Component {
|
||||
constructor() {
|
||||
super();
|
||||
this.state = {
|
||||
restoreOnUnmount: true,
|
||||
loaded: false,
|
||||
autoplayBlocked: false,
|
||||
isStreamHealthy: false,
|
||||
@ -112,7 +113,10 @@ class ScreenshareComponent extends React.Component {
|
||||
|
||||
notify(intl.formatMessage(intlMessages.screenshareStarted), 'info', 'desktop');
|
||||
|
||||
if (getSwapLayout()) toggleSwapLayout(layoutContextDispatch);
|
||||
if (getSwapLayout()) {
|
||||
toggleSwapLayout(layoutContextDispatch)
|
||||
this.setState({ restoreOnUnmount: false });
|
||||
};
|
||||
|
||||
if (hidePresentation) {
|
||||
layoutContextDispatch({
|
||||
@ -132,7 +136,14 @@ class ScreenshareComponent extends React.Component {
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
const { intl, fullscreenContext, layoutContextDispatch, hidePresentation } = this.props;
|
||||
const {
|
||||
intl,
|
||||
fullscreenContext,
|
||||
layoutContextDispatch,
|
||||
hidePresentation,
|
||||
toggleSwapLayout,
|
||||
} = this.props;
|
||||
const { restoreOnUnmount } = this.state;
|
||||
screenshareHasEnded();
|
||||
window.removeEventListener('screensharePlayFailed', this.handlePlayElementFailed);
|
||||
unsubscribeFromStreamStateChange('screenshare', this.onStreamStateChange);
|
||||
@ -149,11 +160,12 @@ class ScreenshareComponent extends React.Component {
|
||||
});
|
||||
}
|
||||
|
||||
if (hidePresentation) {
|
||||
if (hidePresentation || !restoreOnUnmount) {
|
||||
layoutContextDispatch({
|
||||
type: ACTIONS.SET_PRESENTATION_IS_OPEN,
|
||||
value: false,
|
||||
});
|
||||
toggleSwapLayout(layoutContextDispatch);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user