Skip to content

Commit

Permalink
[MM-62241] Fix screen sharing from popout on new Desktop versions (#948)
Browse files Browse the repository at this point in the history
* Fix screen sharing from popout on new Desktop versions

* Fix linting

* Fix leaving call from call post in main desktop view
  • Loading branch information
streamer45 committed Jan 21, 2025
1 parent 21ec305 commit 1f75e35
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import {
callStartedTimestampFn,
getCallPropsFromPost,
getUserDisplayName,
sendDesktopEvent,
shouldRenderDesktopWidget,
toHuman,
untranslatable,
} from 'src/utils';
Expand Down Expand Up @@ -74,9 +72,8 @@ const PostType = ({
// NOTE: this also handles the desktop global widget case since the opener window
// will have the client.
callsClient.disconnect();
} else if (shouldRenderDesktopWidget()) {
// DEPRECATED: legacy Desktop API logic (<= 5.6.0)
sendDesktopEvent('calls-leave-call', {callID: post.channel_id});
} else if (window.desktopAPI?.leaveCall) {
window.desktopAPI.leaveCall();
}
};

Expand Down
9 changes: 1 addition & 8 deletions webapp/src/components/expanded_view/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import React from 'react';
import {OverlayTrigger, Tooltip} from 'react-bootstrap';
import {IntlShape} from 'react-intl';
import {RouteComponentProps} from 'react-router-dom';
import {compareSemVer} from 'semver-parser';
import {hostMuteOthers, hostRemove} from 'src/actions';
import {Badge} from 'src/components/badge';
import CallDuration from 'src/components/call_widget/call_duration';
Expand Down Expand Up @@ -74,7 +73,6 @@ import {
isDMChannel,
sendDesktopEvent,
setCallsGlobalCSSVars,
shouldRenderDesktopWidget,
untranslatable,
} from 'src/utils';
import styled, {createGlobalStyle, css} from 'styled-components';
Expand Down Expand Up @@ -510,14 +508,9 @@ export default class ExpandedView extends React.PureComponent<Props, State> {
});
this.props.trackEvent(Telemetry.Event.UnshareScreen, Telemetry.Source.ExpandedView, {initiator: fromShortcut ? 'shortcut' : 'button'});
} else if (!this.props.screenSharingSession) {
if (window.desktop && compareSemVer(window.desktop.version, '5.1.0') >= 0) {
this.props.showScreenSourceModal();
} else if (window.desktopAPI?.openScreenShareModal) {
if (window.desktopAPI?.openScreenShareModal) {
logDebug('desktopAPI.openScreenShareModal');
window.desktopAPI.openScreenShareModal();
} else if (shouldRenderDesktopWidget()) {
// DEPRECATED: legacy Desktop API logic (<= 5.6.0)
sendDesktopEvent('desktop-sources-modal-request');
} else {
const stream = await getScreenStream('', hasExperimentalFlag());
if (window.opener && stream) {
Expand Down

0 comments on commit 1f75e35

Please sign in to comment.