From 5acdb8233bf77dd0e3b4ef3b5b73f5fa16e78c47 Mon Sep 17 00:00:00 2001 From: wmwragg Date: Mon, 12 Sep 2016 15:04:32 +0100 Subject: [PATCH] The dismiss function now correctly deletes the dismissed element. Also the query render, will now render all invitees --- .../views/dialogs/ChatInviteDialog.js | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/components/views/dialogs/ChatInviteDialog.js b/src/components/views/dialogs/ChatInviteDialog.js index 6d4cf21f70..69dd6764a6 100644 --- a/src/components/views/dialogs/ChatInviteDialog.js +++ b/src/components/views/dialogs/ChatInviteDialog.js @@ -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 = ( - - ); + query = []; + for (let i = 0; i < this.state.inviteList.length; i++) { + query.push( + + ); + } } else { query = (