From 1c5e7f3048f47cc20e15953e9396559e7921d152 Mon Sep 17 00:00:00 2001 From: Luke Barnard Date: Wed, 8 Nov 2017 11:31:04 +0000 Subject: [PATCH] Fix FlairStore getPublicisedGroupsCached to give the correct, existing promise --- src/stores/FlairStore.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/stores/FlairStore.js b/src/stores/FlairStore.js index 1d20148c0d..0f339eaf63 100644 --- a/src/stores/FlairStore.js +++ b/src/stores/FlairStore.js @@ -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) => {