diff --git a/src/components/views/rooms/RoomList.tsx b/src/components/views/rooms/RoomList.tsx
index 0b79f7b52e..eb50224a60 100644
--- a/src/components/views/rooms/RoomList.tsx
+++ b/src/components/views/rooms/RoomList.tsx
@@ -45,7 +45,6 @@ import { objectShallowClone, objectWithOnly } from "../../../utils/objects";
import { IconizedContextMenuOption, IconizedContextMenuOptionList } from "../context_menus/IconizedContextMenu";
import AccessibleButton from "../elements/AccessibleButton";
import { CommunityPrototypeStore } from "../../../stores/CommunityPrototypeStore";
-import CallHandler from "../../../CallHandler";
import SpaceStore, {ISuggestedRoom, SUGGESTED_ROOMS} from "../../../stores/SpaceStore";
import {showAddExistingRooms, showCreateNewRoom, showSpaceInvite} from "../../../utils/space";
import {replaceableComponent} from "../../../utils/replaceableComponent";
@@ -103,38 +102,6 @@ interface ITagAestheticsMap {
[tagId: TagID]: ITagAesthetics;
}
-// If we have no dialer support, we just show the create chat dialog
-const dmOnAddRoom = (dispatcher?: Dispatcher
) => {
- (dispatcher || defaultDispatcher).dispatch({action: 'view_create_chat'});
-};
-
-// If we have dialer support, show a context menu so the user can pick between
-// the dialer and the create chat dialog
-const dmAddRoomContextMenu = (onFinished: () => void) => {
- return
- {
- e.preventDefault();
- e.stopPropagation();
- onFinished();
- defaultDispatcher.dispatch({action: "view_create_chat"});
- }}
- />
- {
- e.preventDefault();
- e.stopPropagation();
- onFinished();
- defaultDispatcher.fire(Action.OpenDialPad);
- }}
- />
- ;
-};
-
const TAG_AESTHETICS: ITagAestheticsMap = {
[DefaultTagID.Invite]: {
sectionLabel: _td("Invites"),
@@ -151,8 +118,9 @@ const TAG_AESTHETICS: ITagAestheticsMap = {
isInvite: false,
defaultHidden: false,
addRoomLabel: _td("Start chat"),
- // Either onAddRoom or addRoomContextMenu are set depending on whether we
- // have dialer support.
+ onAddRoom: (dispatcher?: Dispatcher) => {
+ (dispatcher || defaultDispatcher).dispatch({action: 'view_create_chat'});
+ },
},
[DefaultTagID.Untagged]: {
sectionLabel: _td("Rooms"),
@@ -271,7 +239,6 @@ function customTagAesthetics(tagId: TagID): ITagAesthetics {
export default class RoomList extends React.PureComponent {
private dispatcherRef;
private customTagStoreRef;
- private tagAesthetics: ITagAestheticsMap;
private roomStoreToken: fbEmitter.EventSubscription;
constructor(props: IProps) {
@@ -282,10 +249,6 @@ export default class RoomList extends React.PureComponent {
isNameFiltering: !!RoomListStore.instance.getFirstNameFilterCondition(),
suggestedRooms: SpaceStore.instance.suggestedRooms,
};
-
- // shallow-copy from the template as we need to make modifications to it
- this.tagAesthetics = objectShallowClone(TAG_AESTHETICS);
- this.updateDmAddRoomAction();
}
public componentDidMount(): void {
@@ -311,17 +274,6 @@ export default class RoomList extends React.PureComponent {
});
};
- private updateDmAddRoomAction() {
- const dmTagAesthetics = objectShallowClone(TAG_AESTHETICS[DefaultTagID.DM]);
- if (CallHandler.sharedInstance().getSupportsPstnProtocol()) {
- dmTagAesthetics.addRoomContextMenu = dmAddRoomContextMenu;
- } else {
- dmTagAesthetics.onAddRoom = dmOnAddRoom;
- }
-
- this.tagAesthetics[DefaultTagID.DM] = dmTagAesthetics;
- }
-
private onAction = (payload: ActionPayload) => {
if (payload.action === Action.ViewRoomDelta) {
const viewRoomDeltaPayload = payload as ViewRoomDeltaPayload;
@@ -335,7 +287,6 @@ export default class RoomList extends React.PureComponent {
});
}
} else if (payload.action === Action.PstnSupportUpdated) {
- this.updateDmAddRoomAction();
this.updateLists();
}
};
@@ -524,7 +475,7 @@ export default class RoomList extends React.PureComponent {
const aesthetics: ITagAesthetics = isCustomTag(orderedTagId)
? customTagAesthetics(orderedTagId)
- : this.tagAesthetics[orderedTagId];
+ : TAG_AESTHETICS[orderedTagId];
if (!aesthetics) throw new Error(`Tag ${orderedTagId} does not have aesthetics`);
// The cost of mounting/unmounting this component offsets the cost
diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json
index bc62868a0f..35f4500bb7 100644
--- a/src/i18n/strings/en_EN.json
+++ b/src/i18n/strings/en_EN.json
@@ -1581,8 +1581,6 @@
"Search": "Search",
"Voice call": "Voice call",
"Video call": "Video call",
- "Start a Conversation": "Start a Conversation",
- "Open dial pad": "Open dial pad",
"Invites": "Invites",
"Favourites": "Favourites",
"People": "People",
@@ -2661,6 +2659,7 @@
"Explore Public Rooms": "Explore Public Rooms",
"Create a Group Chat": "Create a Group Chat",
"Upgrade to %(hostSignupBrand)s": "Upgrade to %(hostSignupBrand)s",
+ "Open dial pad": "Open dial pad",
"Failed to reject invitation": "Failed to reject invitation",
"Cannot create rooms in this community": "Cannot create rooms in this community",
"You do not have permission to create rooms in this community.": "You do not have permission to create rooms in this community.",