@@ -27,12 +27,10 @@ import GroupStore from '../../stores/GroupStore';
2727import { RightPanelPhases } from '../../stores/right-panel/RightPanelStorePhases' ;
2828import RightPanelStore from "../../stores/right-panel/RightPanelStore" ;
2929import MatrixClientContext from "../../contexts/MatrixClientContext" ;
30- import { Action } from "../../dispatcher/actions" ;
3130import RoomSummaryCard from "../views/right_panel/RoomSummaryCard" ;
3231import WidgetCard from "../views/right_panel/WidgetCard" ;
3332import { replaceableComponent } from "../../utils/replaceableComponent" ;
3433import SettingsStore from "../../settings/SettingsStore" ;
35- import { ActionPayload } from "../../dispatcher/payloads" ;
3634import MemberList from "../views/rooms/MemberList" ;
3735import GroupMemberList from "../views/groups/GroupMemberList" ;
3836import GroupRoomList from "../views/groups/GroupRoomList" ;
@@ -47,7 +45,6 @@ import ResizeNotifier from "../../utils/ResizeNotifier";
4745import PinnedMessagesCard from "../views/right_panel/PinnedMessagesCard" ;
4846import { RoomPermalinkCreator } from '../../utils/permalinks/Permalinks' ;
4947import { E2EStatus } from '../../utils/ShieldUtils' ;
50- import { dispatchShowThreadsPanelEvent } from '../../dispatcher/dispatch-actions/threads' ;
5148import TimelineCard from '../views/right_panel/TimelineCard' ;
5249import { UPDATE_EVENT } from '../../stores/AsyncStore' ;
5350import { IRightPanelCard , IRightPanelCardState } from '../../stores/right-panel/RightPanelStoreIPanelState' ;
@@ -72,8 +69,6 @@ interface IState {
7269export default class RightPanel extends React . Component < IProps , IState > {
7370 static contextType = MatrixClientContext ;
7471
75- private dispatcherRef : string ;
76-
7772 constructor ( props , context ) {
7873 super ( props , context ) ;
7974
@@ -90,15 +85,13 @@ export default class RightPanel extends React.Component<IProps, IState> {
9085 } , 500 , { leading : true , trailing : true } ) ;
9186
9287 public componentDidMount ( ) : void {
93- this . dispatcherRef = dis . register ( this . onAction ) ;
9488 const cli = this . context ;
9589 cli . on ( "RoomState.members" , this . onRoomStateMember ) ;
9690 RightPanelStore . instance . on ( UPDATE_EVENT , this . onRightPanelStoreUpdate ) ;
9791 this . initGroupStore ( this . props . groupId ) ;
9892 }
9993
10094 public componentWillUnmount ( ) : void {
101- dis . unregister ( this . dispatcherRef ) ;
10295 if ( this . context ) {
10396 this . context . removeListener ( "RoomState.members" , this . onRoomStateMember ) ;
10497 }
@@ -153,14 +146,6 @@ export default class RightPanel extends React.Component<IProps, IState> {
153146 } ) ;
154147 } ;
155148
156- private onAction = ( payload : ActionPayload ) => {
157- const isChangingRoom = payload . action === Action . ViewRoom && payload . room_id !== this . props . room . roomId ;
158- const isViewingThread = this . state . phase === RightPanelPhases . ThreadView ;
159- if ( isChangingRoom && isViewingThread ) {
160- dispatchShowThreadsPanelEvent ( ) ;
161- }
162- } ;
163-
164149 private onClose = ( ) => {
165150 // XXX: There are three different ways of 'closing' this panel depending on what state
166151 // things are in... this knows far more than it should do about the state of the rest
0 commit comments