From 86cbe34181c3705953e83dcfe3e67a49bce836e5 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 14 Sep 2018 18:35:16 +0200 Subject: [PATCH] rerender after members are loaded so pills and RR get rerendered --- src/components/structures/RoomView.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/structures/RoomView.js b/src/components/structures/RoomView.js index 3a2a80f06a..2715a5698d 100644 --- a/src/components/structures/RoomView.js +++ b/src/components/structures/RoomView.js @@ -585,18 +585,23 @@ module.exports = React.createClass({ this._loadMembersIfJoined(); }, - _loadMembersIfJoined: function() { + _loadMembersIfJoined: async function() { // lazy load members if enabled if (SettingsStore.isFeatureEnabled('feature_lazyloading')) { const cli = MatrixClientPeg.get(); const room = cli.getRoom(this.state.roomId); if (room && room.getMyMembership() === 'join') { - room.loadMembersIfNeeded().catch((err) => { + try { + await room.loadMembersIfNeeded(); + if (!this.unmounted) { + this.forceUpdate(); + } + } catch(err) { const errorMessage = `Fetching room members for ${room.roomId} failed.` + " Room members will appear incomplete."; console.error(errorMessage); console.error(err); - }); + } } } },