1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

PR feedback

This commit is contained in:
Bruno Windels
2018-08-03 13:54:28 +02:00
parent 01d8730850
commit 0fa49bc2cd
2 changed files with 8 additions and 8 deletions

View File

@@ -795,14 +795,14 @@ MatrixClient.prototype.loadRoomMembersIfNeeded = async function(roomId) {
if (!room || !room.needsOutOfBandMembers()) { if (!room || !room.needsOutOfBandMembers()) {
return; return;
} }
// intercept whether we need to store oob members afterwards
let membersNeedStoring = false;
// Note that we don't await _loadMembers here first. // Note that we don't await _loadMembers here first.
// setLazyLoadedMembers sets a flag before it awaits the promise passed in // setLazyLoadedMembers sets a flag before it awaits the promise passed in
// to avoid a race when calling membersNeedLoading/loadOutOfBandMembers // to avoid a race when calling membersNeedLoading/loadOutOfBandMembers
// in fast succession, before the first promise resolves. // in fast succession, before the first promise resolves.
let membersPromise = this._loadMembers(room); const membersPromise = this._loadMembers(room)
// intercept whether we need to store oob members afterwards .then(({memberEvents, fromServer}) => {
let membersNeedStoring = false;
membersPromise = membersPromise.then(({memberEvents, fromServer}) => {
membersNeedStoring = fromServer; membersNeedStoring = fromServer;
return memberEvents; return memberEvents;
}); });

View File

@@ -202,7 +202,7 @@ LocalIndexedDBStoreBackend.prototype = {
* Returns the out-of-band membership events for this room that * Returns the out-of-band membership events for this room that
* were previously loaded. * were previously loaded.
* @param {string} roomId * @param {string} roomId
* @returns {event[]} the events, potentially an empty array if OOB loading didn't yield any new members * @returns {Promise<event[]>} the events, potentially an empty array if OOB loading didn't yield any new members
* @returns {null} in case the members for this room haven't been stored yet * @returns {null} in case the members for this room haven't been stored yet
*/ */
getOutOfBandMembers: function(roomId) { getOutOfBandMembers: function(roomId) {