Better feedback in invite dialog
Show feedback if you enter a valid but unknown email address or mxid Fixes https://github.com/vector-im/riot-web/issues/2933
This commit is contained in:
parent
fcb1d7a664
commit
de621902fc
4 changed files with 26 additions and 7 deletions
|
@ -154,14 +154,26 @@ module.exports = React.createClass({
|
|||
},
|
||||
|
||||
onQueryChanged: function(ev) {
|
||||
var query = ev.target.value;
|
||||
var queryList = [];
|
||||
const query = ev.target.value;
|
||||
let queryList = [];
|
||||
|
||||
// Only do search if there is something to search
|
||||
if (query.length > 0) {
|
||||
if (query.length > 0 && query != '@') {
|
||||
// filter the known users list
|
||||
queryList = this._userList.filter((user) => {
|
||||
return this._matches(query, user);
|
||||
}).map((user) => {
|
||||
return user.userId;
|
||||
});
|
||||
|
||||
// If the query isn't a user we know about, but is a
|
||||
// valid address, add an entry for that
|
||||
if (queryList.length == 0) {
|
||||
const addrType = Invite.getAddressType(query);
|
||||
if (addrType !== null) {
|
||||
queryList.push(query);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.setState({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue