diff --git a/lib/selectors/chat-selectors.js b/lib/selectors/chat-selectors.js --- a/lib/selectors/chat-selectors.js +++ b/lib/selectors/chat-selectors.js @@ -115,10 +115,17 @@ getCandidateSidebarItemsForThreadList(sidebars); const lastUpdatedTimeIncludingSidebarsPromise = (async () => { - const candidateSidebarItems = await candidateSidebarItemsPromise; - const lastUpdatedTimes = candidateSidebarItems.map( - sidebarItem => sidebarItem.lastUpdatedTime, - ); + const [lastUpdatedTimeResult, candidateSidebarItems] = + await Promise.all([ + lastUpdatedTimePromise, + candidateSidebarItemsPromise, + ]); + const lastUpdatedTimes = [ + lastUpdatedTimeResult, + ...candidateSidebarItems.map( + sidebarItem => sidebarItem.lastUpdatedTime, + ), + ]; const max = lastUpdatedTimes.reduce((a, b) => Math.max(a, b), -1); return max; })();