Ensure DMs tagged outside of account data work in the invite dialog

Fixes https://github.com/vector-im/riot-web/issues/12418

Includes a refactor so we don't need to litter the code with the same magic string for DM tags.
This commit is contained in:
Travis Ralston 2020-02-24 19:43:11 -07:00
parent 866fdd6185
commit 866ed68615
5 changed files with 45 additions and 24 deletions

View file

@ -28,7 +28,7 @@ import rate_limited_func from "../../../ratelimitedfunc";
import * as Rooms from '../../../Rooms';
import DMRoomMap from '../../../utils/DMRoomMap';
import TagOrderStore from '../../../stores/TagOrderStore';
import RoomListStore from '../../../stores/RoomListStore';
import RoomListStore, {TAG_DM} from '../../../stores/RoomListStore';
import CustomRoomTagStore from '../../../stores/CustomRoomTagStore';
import GroupStore from '../../../stores/GroupStore';
import RoomSubList from '../../structures/RoomSubList';
@ -718,11 +718,11 @@ export default createReactClass({
incomingCall: incomingCallIfTaggedAs('m.favourite'),
},
{
list: this.state.lists['im.vector.fake.direct'],
list: this.state.lists[TAG_DM],
label: _t('Direct Messages'),
tagName: "im.vector.fake.direct",
tagName: TAG_DM,
order: "recent",
incomingCall: incomingCallIfTaggedAs('im.vector.fake.direct'),
incomingCall: incomingCallIfTaggedAs(TAG_DM),
onAddRoom: () => {dis.dispatch({action: 'view_create_chat'});},
addRoomLabel: _t("Start chat"),
},