Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit cea8132

Browse files
committed
Make double-clicking the PiP take you to the call room
Signed-off-by: Šimon Brandner <[email protected]>
1 parent d151f69 commit cea8132

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

src/components/views/voip/CallPreview.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,13 +178,21 @@ export default class CallPreview extends React.Component<IProps, IState> {
178178
});
179179
};
180180

181+
private onDoubleClick = (): void => {
182+
dis.dispatch({
183+
action: "view_room",
184+
room_id: this.state.primaryCall.roomId,
185+
});
186+
};
187+
181188
public render() {
182189
const pipMode = true;
183190
if (this.state.primaryCall) {
184191
return (
185192
<PictureInPictureDragger
186193
className="mx_CallPreview"
187194
draggable={pipMode}
195+
onDoubleClick={this.onDoubleClick}
188196
>
189197
{ ({ onStartMoving, onResize }) => <CallView
190198
onMouseDownOnHeader={onStartMoving}

src/components/views/voip/PictureInPictureDragger.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ interface IProps {
4242
className?: string;
4343
children: ({ onStartMoving, onResize }: IChildrenOptions) => React.ReactNode;
4444
draggable: boolean;
45+
onDoubleClick?: () => void;
4546
}
4647

4748
interface IState {
@@ -216,6 +217,7 @@ export default class PictureInPictureDragger extends React.Component<IProps, ISt
216217
className={this.props.className}
217218
style={this.props.draggable ? style : undefined}
218219
ref={this.callViewWrapper}
220+
onDoubleClick={this.props.onDoubleClick}
219221
>
220222
<>
221223
{ this.props.children({

0 commit comments

Comments
 (0)