Commit 5ebef515 authored by Robert Knight's avatar Robert Knight

Combine two `then` Promise callbacks into one

The first block produced a result synchronously, so it could be combined
into the second block.
parent d89df221
......@@ -270,16 +270,14 @@ function groups(
return Promise.all([myGroups, allFeaturedGroups, documentUri, token]);
})
.then(([myGroups, featuredGroups, documentUri, token]) => {
const groups = combineGroups(myGroups, featuredGroups, documentUri);
const isLoggedIn = token !== null;
return filterGroups(
groups,
const groups = filterGroups(
combineGroups(myGroups, featuredGroups, documentUri),
isLoggedIn,
directLinkedAnnotationGroupId,
directLinkedGroupId
);
})
.then(groups => {
injectOrganizations(groups);
const isFirstLoad = store.allGroups().length === 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment