Skip to content

Commit dd0d27b

Browse files
committed
Hide the Show/Hide Sidebar from the Picture-in-Picture preview
The toggle sidebar button currently does nothing in PIP mode, since PIP mode never shows a sidebar (even when the call is made fullscreen from the PIP preview)
1 parent 7150068 commit dd0d27b

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/LegacyCallHandler.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ export default class LegacyCallHandler extends TypedEventEmitter<LegacyCallHandl
250250
}
251251

252252
public isCallSidebarShown(callId?: string): boolean {
253-
return (!!callId && (this.shownSidebars.get(callId) ?? true));
253+
return !!callId && (this.shownSidebars.get(callId) ?? true);
254254
}
255255

256256
private async checkProtocols(maxTries: number): Promise<void> {

src/components/views/voip/LegacyCallView.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,8 @@ export default class LegacyCallView extends React.Component<IProps, IState> {
340340
(call.opponentSupportsSDPStreamMetadata() || call.hasLocalUserMediaVideoTrack) &&
341341
call.state === CallState.Connected;
342342
// Show the sidebar button only if there is something to hide/show
343-
const sidebarButtonShown = (secondaryFeed && !secondaryFeed.isVideoMuted()) || sidebarFeeds.length > 0;
343+
const sidebarButtonShown =
344+
!pipMode && ((secondaryFeed && !secondaryFeed.isVideoMuted()) || sidebarFeeds.length > 0);
344345
// The dial pad & 'more' button actions are only relevant in a connected call
345346
const contextMenuButtonShown = callState === CallState.Connected;
346347
const dialpadButtonShown = callState === CallState.Connected && call.opponentSupportsDTMF();

src/components/views/voip/LegacyCallViewForRoom.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,13 @@ export default class LegacyCallViewForRoom extends React.Component<IProps, IStat
111111
className="mx_LegacyCallViewForRoom_ResizeWrapper"
112112
handleClasses={{ bottom: "mx_LegacyCallViewForRoom_ResizeHandle" }}
113113
>
114-
<LegacyCallView call={this.state.call} pipMode={false} showApps={this.props.showApps} sidebarShown={this.state.sidebarShown} setSidebarShown={this.setSidebarShown}/>
114+
<LegacyCallView
115+
call={this.state.call}
116+
pipMode={false}
117+
showApps={this.props.showApps}
118+
sidebarShown={this.state.sidebarShown}
119+
setSidebarShown={this.setSidebarShown}
120+
/>
115121
</Resizable>
116122
</div>
117123
);

0 commit comments

Comments
 (0)