Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
3d09d3f6
Commit
3d09d3f6
authored
May 13, 2019
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify `groups#load` by calling `combineGroups` in one place
parent
13543328
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
14 deletions
+7
-14
groups.js
src/sidebar/services/groups.js
+7
-14
No files found.
src/sidebar/services/groups.js
View file @
3d09d3f6
...
@@ -255,34 +255,27 @@ function groups(
...
@@ -255,34 +255,27 @@ function groups(
// If the directLinkedAnnotation's group fetch failed, return
// If the directLinkedAnnotation's group fetch failed, return
// the list of groups without it.
// the list of groups without it.
if
(
!
directLinkedAnnGroup
)
{
if
(
!
directLinkedAnnGroup
)
{
return
[
return
[
myGroups
,
allFeaturedGroups
,
documentUri
,
token
];
combineGroups
(
myGroups
,
allFeaturedGroups
,
documentUri
),
token
,
];
}
}
// If the directLinkedAnnotation's group fetch was successful,
// If the directLinkedAnnotation's group fetch was successful,
// combine it with the other groups.
// combine it with the other groups.
return
[
return
[
combineGroups
(
myGroups
,
myGroups
,
allFeaturedGroups
.
concat
(
directLinkedAnnGroup
),
allFeaturedGroups
.
concat
(
directLinkedAnnGroup
),
documentUri
documentUri
,
),
token
,
token
,
];
];
});
});
}
}
}
}
// If there is no direct-linked annotation, return the list of groups without it.
// If there is no direct-linked annotation, return the list of groups without it.
return
[
return
[
myGroups
,
allFeaturedGroups
,
documentUri
,
token
];
combineGroups
(
myGroups
,
allFeaturedGroups
,
documentUri
),
token
,
];
}
}
);
);
})
})
.
then
(([
groups
,
token
])
=>
{
.
then
(([
myGroups
,
featuredGroups
,
documentUri
,
token
])
=>
{
const
groups
=
combineGroups
(
myGroups
,
featuredGroups
,
documentUri
);
const
isLoggedIn
=
token
!==
null
;
const
isLoggedIn
=
token
!==
null
;
return
filterGroups
(
return
filterGroups
(
groups
,
groups
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment