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

Commit

Permalink
remove all the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
toger5 committed Dec 9, 2021
1 parent 3349076 commit 3bad57f
Show file tree
Hide file tree
Showing 18 changed files with 17 additions and 420 deletions.
5 changes: 0 additions & 5 deletions src/TextForEvent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -504,11 +504,6 @@ const onPinnedOrUnpinnedMessageClick = (messageId: string, roomId: string): void

const onPinnedMessagesClick = (): void => {
RightPanelStore.instance.setRightPanel(RightPanelPhases.PinnedMessages, null, false);
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.PinnedMessages,
// allowClose: false,
// });
};

function textForPinnedEvent(event: MatrixEvent, allowJSX: boolean): () => string | JSX.Element | null {
Expand Down
4 changes: 0 additions & 4 deletions src/components/structures/GroupView.js
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,6 @@ export default class GroupView extends React.Component {

_onAdminsLinkClick = () => {
RightPanelStore.instance.setRightPanel(RightPanelPhases.GroupMemberList);
// dis.dispatch({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.GroupMemberList,
// });
};

_getGroupSection() {
Expand Down
4 changes: 0 additions & 4 deletions src/components/structures/RoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -331,10 +331,6 @@ export class RoomView extends React.Component<IRoomProps, IRoomState> {
if (WidgetLayoutStore.instance.hasMaximisedWidget(this.state.room)) {
// Show chat in right panel when a widget is maximised
RightPanelStore.instance.setRightPanel(RightPanelPhases.Timeline);
// dis.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.Timeline,
// });
}
this.checkWidgets(this.state.room);
// this.checkRightPanel(this.state.room);
Expand Down
32 changes: 0 additions & 32 deletions src/components/structures/SpaceRoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,12 +165,6 @@ const SpaceInfo = ({ space }: { space: Room }) => {
className="mx_SpaceRoomView_info_memberCount"
onClick={() => {
RightPanelStore.instance.setRightPanel(RightPanelPhases.RoomMemberList, { space } );

// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.RoomMemberList,
// refireParams: { space },
// });
}}
>
{ _t("%(count)s members", { count }) }
Expand Down Expand Up @@ -476,11 +470,6 @@ const SpaceLanding = ({ space }: { space: Room }) => {

const onMembersClick = () => {
RightPanelStore.instance.setRightPanel(RightPanelPhases.RoomMemberList, { space } );
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.RoomMemberList,
// refireParams: { space },
// });
};

return <div className="mx_SpaceRoomView_landing">
Expand Down Expand Up @@ -855,37 +844,16 @@ export default class SpaceRoomView extends React.PureComponent<IProps, IState> {
RightPanelPhases.SpaceMemberInfo,
{ space: this.props.space, member: payload.member },
);
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.SpaceMemberInfo,
// refireParams: {
// space: this.props.space,
// member: payload.member,
// },
// });
} else if (payload.action === "view_3pid_invite" && payload.event) {
RightPanelStore.instance.setRightPanel(
RightPanelPhases.Space3pidMemberInfo,
{ space: this.props.space, member: payload.member },
);
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.Space3pidMemberInfo,
// refireParams: {
// space: this.props.space,
// event: payload.event,
// },
// });
} else {
RightPanelStore.instance.setRightPanel(
RightPanelPhases.SpaceMemberList,
{ space: this.props.space },
);
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.SpaceMemberList,
// refireParams: { space: this.props.space },
// });
}
};

Expand Down
6 changes: 1 addition & 5 deletions src/components/structures/ThreadView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,10 +94,6 @@ export default class ThreadView extends React.Component<IProps, IState> {

if (prevProps.room !== this.props.room) {
RightPanelStore.instance.setRightPanel( RightPanelPhases.RoomSummary );
// dis.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.RoomSummary,
// });
}
}

Expand Down Expand Up @@ -206,7 +202,7 @@ export default class ThreadView extends React.Component<IProps, IState> {
event_id: this.state.thread?.id,
};

let previousPhase = RightPanelStore.instance.previousRoom.phase;
let previousPhase = RightPanelStore.instance.previousPanel.phase;
if (!SettingsStore.getValue("feature_maximised_widgets")) {
previousPhase = RightPanelPhases.ThreadPanel;
}
Expand Down
5 changes: 0 additions & 5 deletions src/components/views/context_menus/RoomContextMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,6 @@ const RoomContextMenu = ({ room, onFinished, ...props }: IProps) => {

ensureViewingRoom();
RightPanelStore.instance.setRightPanel( RightPanelPhases.RoomSummary, null, false );
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.RoomSummary,
// allowClose: false,
// });
onFinished();
}}
label={_t("Widgets")}
Expand Down
5 changes: 0 additions & 5 deletions src/components/views/elements/MemberEventListSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@ import RightPanelStore from '../../../stores/right-panel/RightPanelStore';

const onPinnedMessagesClick = (): void => {
RightPanelStore.instance.setRightPanel( RightPanelPhases.PinnedMessages, null, false );
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.PinnedMessages,
// allowClose: false,
// });
};

const SENDER_AS_DISPLAY_NAME_EVENTS = [EventType.RoomServerAcl, EventType.RoomPinnedEvents];
Expand Down
5 changes: 0 additions & 5 deletions src/components/views/groups/GroupMemberList.js
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,6 @@ export default class GroupMemberList extends React.Component {
RightPanelPhases.GroupMemberList,
{ groupId: this.props.groupId },
);
// dis.dispatch({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.GroupMemberList,
// refireParams: { groupId: this.props.groupId },
// });
});
};

Expand Down
5 changes: 0 additions & 5 deletions src/components/views/messages/MKeyVerificationRequest.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@ export default class MKeyVerificationRequest extends React.Component<IProps> {
const { verificationRequest } = this.props.mxEvent;
const member = MatrixClientPeg.get().getUser(verificationRequest.otherUserId);
RightPanelStore.instance.setRightPanel(RightPanelPhases.EncryptionPanel, { verificationRequest, member } );
// dis.dispatch({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.EncryptionPanel,
// refireParams: { verificationRequest, member },
// });
};

private onRequestChanged = () => {
Expand Down
5 changes: 0 additions & 5 deletions src/components/views/right_panel/BaseCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ const BaseCard: React.FC<IProps> = ({
// RightPanelStore.instance.popRightPanel();

RightPanelStore.instance.setRightPanel(previousPhase, refireParams );
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: previousPhase,
// refireParams: refireParams,
// });
};
const label = previousPhaseLabel ?? _t("Back");
backButton = <AccessibleButton className="mx_BaseCard_back" onClick={onBackClick} title={label} />;
Expand Down
5 changes: 0 additions & 5 deletions src/components/views/right_panel/EncryptionPanel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,6 @@ const EncryptionPanel: React.FC<IProps> = (props: IProps) => {
RightPanelPhases.EncryptionPanel,
{ member, verificationRequest: verificationRequest_ },
);
// dis.dispatch({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.EncryptionPanel,
// refireParams: { member, verificationRequest: verificationRequest_ },
// });
}, [member]);

const requested =
Expand Down
5 changes: 0 additions & 5 deletions src/components/views/right_panel/HeaderButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,6 @@ export default abstract class HeaderButtons<P = {}> extends React.Component<IPro

public setPhase(phase: RightPanelPhases, extras?: Partial<IPanelState>) {
RightPanelStore.instance.setRightPanel(phase, extras);
// dis.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: phase,
// refireParams: extras,
// });
}

public isPhase(phases: string | string[]) {
Expand Down
17 changes: 0 additions & 17 deletions src/components/views/right_panel/RoomSummaryCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,13 +99,6 @@ const AppRow: React.FC<IAppRowProps> = ({ app, room }) => {
const onOpenWidgetClick = () => {
// TODO RightPanelPhase: should push the widget
RightPanelStore.instance.setRightPanel(RightPanelPhases.Widget, { widgetId: app.id });
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.Widget,
// refireParams: {
// widgetId: app.id,
// },
// });
};

const isPinned = WidgetLayoutStore.instance.isInContainer(room, app, Container.Top);
Expand Down Expand Up @@ -235,21 +228,11 @@ const AppsSection: React.FC<IAppsSectionProps> = ({ room }) => {
export const onRoomMembersClick = (allowClose = true) => {
// TODO RightPanelStore: should push the phase
RightPanelStore.instance.setRightPanel(RightPanelPhases.RoomMemberList, undefined, allowClose);
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.RoomMemberList,
// allowClose,
// });
};

export const onRoomFilesClick = (allowClose = true) => {
// TODO RightPanelStore: should push the phase
RightPanelStore.instance.setRightPanel(RightPanelPhases.FilePanel, undefined, allowClose);
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.FilePanel,
// allowClose,
// });
};

const onRoomSettingsClick = () => {
Expand Down
5 changes: 0 additions & 5 deletions src/components/views/right_panel/UserInfo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1660,11 +1660,6 @@ const UserInfo: React.FC<IProps> = ({
const onEncryptionPanelClose = () => {
// TODO RightPanelStore: here we want to pop the panel
RightPanelStore.instance.setRightPanel(previousPhase, refireParams);
// dis.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: previousPhase,
// refireParams: refireParams,
// });
};

let content;
Expand Down
4 changes: 0 additions & 4 deletions src/components/views/right_panel/WidgetCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ const WidgetCard: React.FC<IProps> = ({ room, widgetId, onClose }) => {

//TODO RightPanelStore: here we want to just pop the widget card.
RightPanelStore.instance.setRightPanel(RightPanelPhases.RoomSummary);
// defaultDispatcher.dispatch<SetRightPanelPhasePayload>({
// action: Action.SetRightPanelPhase,
// phase: RightPanelPhases.RoomSummary,
// });
}
}, [app, isPinned]);

Expand Down
1 change: 0 additions & 1 deletion src/components/views/rooms/RoomListHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,6 @@ const PrototypeCommunityContextMenu = (props) => {
room_id: chat.roomId,
}, true);
RightPanelStore.instance.setRightPanel(RightPanelPhases.RoomMemberList, undefined, undefined, chat.roomId);
// dis.dispatch({ action: Action.SetRightPanelPhase, phase: RightPanelPhases.RoomMemberList });
} else {
// "This should never happen" clauses go here for the prototype.
Modal.createTrackedDialog('Failed to find general chat', '', ErrorDialog, {
Expand Down
Loading

0 comments on commit 3bad57f

Please sign in to comment.