You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-28 05:03:59 +03:00
PR feedback
This commit is contained in:
@@ -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;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user