Revert "Fix: Right panel keeps showing chat when unmaximizing widget. (#11697)" (#11786)

This reverts commit c44c772246.
This commit is contained in:
Kerry 2023-10-24 19:49:45 +13:00 committed by GitHub
parent 42db15fc0d
commit 9eb44105cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 19 deletions

View file

@ -129,20 +129,4 @@ describe("Widget Layout", () => {
cy.get('iframe[title="widget"]').invoke("height").should("be.greaterThan", 400); cy.get('iframe[title="widget"]').invoke("height").should("be.greaterThan", 400);
}); });
it("open right panel with chat when maximizing widget", () => {
cy.get('iframe[title="widget"]').invoke("height").should("be.lessThan", 250);
cy.findByRole("button", { name: "Maximise" }).click();
cy.get(".mx_RightPanel").within(() => {
cy.get(".mx_BaseCard_header").should("contain", "Chat");
});
});
it("close right panel with chat when unmaximizing widget", () => {
cy.get('iframe[title="widget"]').invoke("height").should("be.lessThan", 250);
cy.findByRole("button", { name: "Maximise" }).click();
cy.get(".mx_RightPanel").within(() => {
cy.get(".mx_BaseCard_header").should("contain", "Chat");
});
cy.findByRole("button", { name: "Un-maximise" }).click();
cy.get(".mx_RightPanel").should("not.exist");
});
}); });

View file

@ -539,9 +539,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
if (this.context.widgetLayoutStore.hasMaximisedWidget(this.state.room)) { if (this.context.widgetLayoutStore.hasMaximisedWidget(this.state.room)) {
// Show chat in right panel when a widget is maximised // Show chat in right panel when a widget is maximised
this.context.rightPanelStore.setCard({ phase: RightPanelPhases.Timeline }); this.context.rightPanelStore.setCard({ phase: RightPanelPhases.Timeline });
} else {
// Close the chat in right panel when the widget is unmaximised
this.context.rightPanelStore.togglePanel(null);
} }
this.checkWidgets(this.state.room); this.checkWidgets(this.state.room);
}; };