mirror of
https://github.com/element-hq/element-web
synced 2024-11-27 11:47:23 +03:00
The dismiss function now correctly deletes the dismissed element. Also the query render, will now render all invitees
This commit is contained in:
parent
d538377b82
commit
5acdb8233b
1 changed files with 16 additions and 8 deletions
|
@ -138,11 +138,16 @@ module.exports = React.createClass({
|
|||
this.setState({ queryList: queryList });
|
||||
},
|
||||
|
||||
onDismissed: function() {
|
||||
this.setState({
|
||||
inviteList: [],
|
||||
queryList: [],
|
||||
});
|
||||
onDismissed: function(index) {
|
||||
var self = this;
|
||||
return function() {
|
||||
var inviteList = self.state.inviteList.slice();
|
||||
inviteList.splice(index, 1);
|
||||
self.setState({
|
||||
inviteList: inviteList,
|
||||
queryList: [],
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
onClick: function(index) {
|
||||
|
@ -234,9 +239,12 @@ module.exports = React.createClass({
|
|||
var query;
|
||||
if (this.state.inviteList.length > 0) {
|
||||
var AddressTile = sdk.getComponent("elements.AddressTile");
|
||||
query = (
|
||||
<AddressTile user={this.state.inviteList[0]} canDismiss={true} onDismissed={this.onDismissed} />
|
||||
);
|
||||
query = [];
|
||||
for (let i = 0; i < this.state.inviteList.length; i++) {
|
||||
query.push(
|
||||
<AddressTile key={i} user={this.state.inviteList[0]} canDismiss={true} onDismissed={ this.onDismissed(i) } />
|
||||
);
|
||||
}
|
||||
} else {
|
||||
query = (
|
||||
<textarea rows="1"
|
||||
|
|
Loading…
Reference in a new issue