Fix missed case of validAddressTypes being conditional

Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
pull/21833/head
Michael Telatynski 2019-09-12 12:34:14 +01:00
parent 043a8d35e6
commit a40ecda993
1 changed files with 2 additions and 9 deletions

View File

@ -43,8 +43,6 @@ function inviteMultipleToRoom(roomId, addrs) {
export function showStartChatInviteDialog() {
const AddressPickerDialog = sdk.getComponent("dialogs.AddressPickerDialog");
const validAddressTypes = ['mx-user-id', 'email'];
Modal.createTrackedDialog('Start a chat', '', AddressPickerDialog, {
title: _t('Start a chat'),
description: _t("Who would you like to communicate with?"),
@ -56,7 +54,7 @@ export function showStartChatInviteDialog() {
}
return _t("Name or Matrix ID");
},
validAddressTypes,
validAddressTypes: ['mx-user-id', 'email'],
button: _t("Start Chat"),
onFinished: _onStartDmFinished,
});
@ -65,11 +63,6 @@ export function showStartChatInviteDialog() {
export function showRoomInviteDialog(roomId) {
const AddressPickerDialog = sdk.getComponent("dialogs.AddressPickerDialog");
const validAddressTypes = ['mx-user-id'];
if (MatrixClientPeg.get().getIdentityServerUrl()) {
validAddressTypes.push('email');
}
Modal.createTrackedDialog('Chat Invite', '', AddressPickerDialog, {
title: _t('Invite new room members'),
button: _t('Send Invites'),
@ -81,7 +74,7 @@ export function showRoomInviteDialog(roomId) {
}
return _t("Name or Matrix ID");
},
validAddressTypes,
validAddressTypes: ['mx-user-id', 'email'],
onFinished: (shouldInvite, addrs) => {
_onRoomInviteFinished(roomId, shouldInvite, addrs);
},