mirror of https://github.com/vector-im/riot-web
Filter out empty strings when pasting IDs into the invite dialog
Fixes https://github.com/vector-im/riot-web/issues/12459pull/21833/head
parent
82eefb69f6
commit
c906b9eccf
|
@ -801,7 +801,7 @@ export default class InviteDialog extends React.PureComponent {
|
||||||
];
|
];
|
||||||
const toAdd = [];
|
const toAdd = [];
|
||||||
const failed = [];
|
const failed = [];
|
||||||
const potentialAddresses = text.split(/[\s,]+/);
|
const potentialAddresses = text.split(/[\s,]+/).map(p => p.trim()).filter(p => !!p); // filter empty strings
|
||||||
for (const address of potentialAddresses) {
|
for (const address of potentialAddresses) {
|
||||||
const member = possibleMembers.find(m => m.userId === address);
|
const member = possibleMembers.find(m => m.userId === address);
|
||||||
if (member) {
|
if (member) {
|
||||||
|
|
Loading…
Reference in New Issue