Show GroupMemberList after inviting a group member
because we might be looking at a member when inviting a new member. See https://github.com/vector-im/riot-web/pull/6303
This commit is contained in:
parent
e87f8ee7b8
commit
0a480b05aa
1 changed files with 23 additions and 21 deletions
|
@ -22,28 +22,30 @@ import MatrixClientPeg from './MatrixClientPeg';
|
||||||
import GroupStoreCache from './stores/GroupStoreCache';
|
import GroupStoreCache from './stores/GroupStoreCache';
|
||||||
|
|
||||||
export function showGroupInviteDialog(groupId) {
|
export function showGroupInviteDialog(groupId) {
|
||||||
const description = <div>
|
return new Promise((resolve, reject) => {
|
||||||
<div>{ _t("Who would you like to add to this community?") }</div>
|
const description = <div>
|
||||||
<div className="warning">
|
<div>{ _t("Who would you like to add to this community?") }</div>
|
||||||
{ _t(
|
<div className="warning">
|
||||||
"Warning: any person you add to a community will be publicly "+
|
{ _t(
|
||||||
"visible to anyone who knows the community ID",
|
"Warning: any person you add to a community will be publicly "+
|
||||||
) }
|
"visible to anyone who knows the community ID",
|
||||||
</div>
|
) }
|
||||||
</div>;
|
</div>
|
||||||
|
</div>;
|
||||||
|
|
||||||
const AddressPickerDialog = sdk.getComponent("dialogs.AddressPickerDialog");
|
const AddressPickerDialog = sdk.getComponent("dialogs.AddressPickerDialog");
|
||||||
Modal.createTrackedDialog('Group Invite', '', AddressPickerDialog, {
|
Modal.createTrackedDialog('Group Invite', '', AddressPickerDialog, {
|
||||||
title: _t("Invite new community members"),
|
title: _t("Invite new community members"),
|
||||||
description: description,
|
description: description,
|
||||||
placeholder: _t("Name or matrix ID"),
|
placeholder: _t("Name or matrix ID"),
|
||||||
button: _t("Invite to Community"),
|
button: _t("Invite to Community"),
|
||||||
validAddressTypes: ['mx-user-id'],
|
validAddressTypes: ['mx-user-id'],
|
||||||
onFinished: (success, addrs) => {
|
onFinished: (success, addrs) => {
|
||||||
if (!success) return;
|
if (!success) return;
|
||||||
|
|
||||||
_onGroupInviteFinished(groupId, addrs);
|
_onGroupInviteFinished(groupId, addrs).then(resolve, reject);
|
||||||
},
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,7 +89,7 @@ function _onGroupInviteFinished(groupId, addrs) {
|
||||||
|
|
||||||
const addrTexts = addrs.map((addr) => addr.address);
|
const addrTexts = addrs.map((addr) => addr.address);
|
||||||
|
|
||||||
multiInviter.invite(addrTexts).then((completionStates) => {
|
return multiInviter.invite(addrTexts).then((completionStates) => {
|
||||||
// Show user any errors
|
// Show user any errors
|
||||||
const errorList = [];
|
const errorList = [];
|
||||||
for (const addr of Object.keys(completionStates)) {
|
for (const addr of Object.keys(completionStates)) {
|
||||||
|
|
Loading…
Reference in a new issue