Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MM-62241] Fix screen sharing from popout on new Desktop versions #948

Merged
merged 6 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -16,7 +16,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 @@ -73,7 +72,6 @@ import {
isDMChannel,
sendDesktopEvent,
setCallsGlobalCSSVars,
shouldRenderDesktopWidget,
untranslatable,
} from 'src/utils';
import styled, {createGlobalStyle, css} from 'styled-components';
Expand Down Expand Up @@ -493,14 +491,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
Loading