Fix vector-im/vector-web#694 - Empty invitee list

The invitee list is lazy-loaded 50ms after the first render. We were relying
on setState from the member lazy-load to also kick the invitee list. However,
setState is synchronous and we were loading the invitee list afterwards, which
meant that the SearchableEntityList wouldn't have any invitees until the next
render().
pull/21833/head
Kegan Dougal 2016-01-22 16:11:09 +00:00
parent 38d5c7d5c5
commit 99da0ef656
1 changed files with 4 additions and 2 deletions

View File

@ -69,11 +69,13 @@ module.exports = React.createClass({
// Lazy-load in more than the first N members // Lazy-load in more than the first N members
setTimeout(function() { setTimeout(function() {
if (!self.isMounted()) return; if (!self.isMounted()) return;
// lazy load to prevent it blocking the first render
self._loadUserList();
self.setState({ self.setState({
members: self.roomMembers() members: self.roomMembers()
}); });
// lazy load to prevent it blocking the first render
self._loadUserList();
}, 50); }, 50);
// Attach a SINGLE listener for global presence changes then locate the // Attach a SINGLE listener for global presence changes then locate the