Merge pull request #1590 from matrix-org/luke/fix-flair-store-2

Fix FlairStore getPublicisedGroupsCached to give the correct, existing promise
This commit is contained in:
David Baker 2017-11-08 11:36:30 +00:00 committed by GitHub
commit 20a16d71b8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -69,9 +69,13 @@ class FlairStore extends EventEmitter {
}
// Bulk lookup ongoing, return promise to resolve/reject
if (this._usersPending[userId] || this._usersInFlight[userId]) {
if (this._usersPending[userId]) {
return this._usersPending[userId].prom;
}
// User has been moved from pending to in-flight
if (this._usersInFlight[userId]) {
return this._usersInFlight[userId].prom;
}
this._usersPending[userId] = {};
this._usersPending[userId].prom = new Promise((resolve, reject) => {