Commit 3d09d3f6 authored by Robert Knight's avatar Robert Knight

Simplify `groups#load` by calling `combineGroups` in one place

parent 13543328
......@@ -255,34 +255,27 @@ function groups(
// If the directLinkedAnnotation's group fetch failed, return
// the list of groups without it.
if (!directLinkedAnnGroup) {
return [
combineGroups(myGroups, allFeaturedGroups, documentUri),
token,
];
return [myGroups, allFeaturedGroups, documentUri, token];
}
// If the directLinkedAnnotation's group fetch was successful,
// combine it with the other groups.
return [
combineGroups(
myGroups,
allFeaturedGroups.concat(directLinkedAnnGroup),
documentUri
),
documentUri,
token,
];
});
}
}
// If there is no direct-linked annotation, return the list of groups without it.
return [
combineGroups(myGroups, allFeaturedGroups, documentUri),
token,
];
return [myGroups, allFeaturedGroups, documentUri, token];
}
);
})
.then(([groups, token]) => {
.then(([myGroups, featuredGroups, documentUri, token]) => {
const groups = combineGroups(myGroups, featuredGroups, documentUri);
const isLoggedIn = token !== null;
return filterGroups(
groups,
......
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