Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Closed
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
14 changes: 5 additions & 9 deletions src/components/structures/PipContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -192,10 +192,7 @@ class PipContainerInner extends React.Component<IProps, IState> {
};

private onWidgetPersistence = (): void => {
this.updateShowWidgetInPip(
ActiveWidgetStore.instance.getPersistentWidgetId(),
ActiveWidgetStore.instance.getPersistentRoomId(),
);
this.updateShowWidgetInPip();
};

private onWidgetDockChanges = (): void => {
Expand Down Expand Up @@ -234,11 +231,10 @@ class PipContainerInner extends React.Component<IProps, IState> {
}
};

// Accepts a persistentWidgetId to be able to skip awaiting the setState for persistentWidgetId
public updateShowWidgetInPip(
persistentWidgetId = this.state.persistentWidgetId,
persistentRoomId = this.state.persistentRoomId,
): void {
private updateShowWidgetInPip(): void {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changed from public to private. Should we keep it public?

const persistentWidgetId = ActiveWidgetStore.instance.getPersistentWidgetId();
const persistentRoomId = ActiveWidgetStore.instance.getPersistentRoomId();

let fromAnotherRoom = false;
let notDocked = false;
// Sanity check the room - the widget may have been destroyed between render cycles, and
Expand Down