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( ...@@ -270,16 +270,14 @@ function groups(
return Promise.all([myGroups, allFeaturedGroups, documentUri, token]); return Promise.all([myGroups, allFeaturedGroups, documentUri, token]);
}) })
.then(([myGroups, featuredGroups, documentUri, token]) => { .then(([myGroups, featuredGroups, documentUri, token]) => {
const groups = combineGroups(myGroups, featuredGroups, documentUri);
const isLoggedIn = token !== null; const isLoggedIn = token !== null;
return filterGroups( const groups = filterGroups(
groups, combineGroups(myGroups, featuredGroups, documentUri),
isLoggedIn, isLoggedIn,
directLinkedAnnotationGroupId, directLinkedAnnotationGroupId,
directLinkedGroupId directLinkedGroupId
); );
})
.then(groups => {
injectOrganizations(groups); injectOrganizations(groups);
const isFirstLoad = store.allGroups().length === 0; 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