You've already forked matrix-react-sdk
mirror of
https://github.com/matrix-org/matrix-react-sdk.git
synced 2025-11-10 09:22:25 +03:00
Refactored AddressTile to use string address rather than user object, so it can user email as well mx userId
This commit is contained in:
@@ -73,7 +73,7 @@ module.exports = React.createClass({
|
||||
|
||||
// Either an address tile was created, or text input is being used
|
||||
if (this.state.inviteList[0]) {
|
||||
addr = this.state.inviteList[0].userId;
|
||||
addr = this.state.inviteList[0];
|
||||
} else {
|
||||
addr = this.refs.textinput.value;
|
||||
}
|
||||
@@ -159,7 +159,7 @@ module.exports = React.createClass({
|
||||
|
||||
onSelected: function(index) {
|
||||
var inviteList = this.state.inviteList.slice();
|
||||
inviteList.push(this.state.queryList[index]);
|
||||
inviteList.push(this.state.queryList[index].userId.toLowerCase());
|
||||
this.setState({
|
||||
inviteList: inviteList,
|
||||
queryList: [],
|
||||
@@ -238,7 +238,7 @@ module.exports = React.createClass({
|
||||
|
||||
_isOnInviteList: function(uid) {
|
||||
for (let i = 0; i < this.state.inviteList.length; i++) {
|
||||
if (this.state.inviteList[i].userId.toLowerCase() === uid) {
|
||||
if (this.state.inviteList[i] === uid) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -256,7 +256,7 @@ module.exports = React.createClass({
|
||||
var AddressTile = sdk.getComponent("elements.AddressTile");
|
||||
for (let i = 0; i < this.state.inviteList.length; i++) {
|
||||
query.push(
|
||||
<AddressTile key={i} user={this.state.inviteList[i]} canDismiss={true} onDismissed={ this.onDismissed(i) } />
|
||||
<AddressTile key={i} address={this.state.inviteList[i]} canDismiss={true} onDismissed={ this.onDismissed(i) } />
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user