Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
moodlenet
MoodleNet Frontend
Commits
eda95916
Commit
eda95916
authored
Jun 03, 2020
by
aleclofabbro
Browse files
Merge branch 'cleanup/removed_some_todo_fixme_comments' into develop
parents
ed6aa11b
363ae937
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/HOC/modules/FeaturedCollections/featuredCollections.tsx
View file @
eda95916
...
...
@@ -18,7 +18,6 @@ export const FeaturedCollections: FC<FeaturedCollections> = () => {
featuredCollectionsPage
.
edges
.
map
(
feature
=>
feature
.
context
)
.
filter
(
//FIXME: remove when fixed nullable context
(
maybeCtx
):
maybeCtx
is
DiscoverPageFeaturedCollectionInfoFragment
=>
!!
maybeCtx
&&
maybeCtx
.
__typename
===
'
Collection
'
)
...
...
@@ -33,7 +32,7 @@ export const FeaturedCollections: FC<FeaturedCollections> = () => {
()
=>
({
collection
,
done
})
=>
{
const
collectionFeature
=
featuredCollectionsPage
.
edges
.
find
(
feature
=>
feature
.
context
?.
__typename
===
'
Collection
'
&&
//FIXME: remove ? when fixed
feature
.
context
?.
__typename
===
'
Collection
'
&&
feature
.
context
.
id
===
collection
.
id
);
const
featureId
=
collectionFeature
?.
id
;
...
...
src/HOC/modules/FeaturedCommunities/featuredCommunities.tsx
View file @
eda95916
...
...
@@ -18,7 +18,6 @@ export const FeaturedCommunities: FC<FeaturedCommunities> = () => {
featuredCommunitiesPage
.
edges
.
map
(
feature
=>
feature
.
context
)
.
filter
(
//FIXME: remove when fixed nullable context
(
maybeCtx
):
maybeCtx
is
DiscoverPageFeaturedCommunityInfoFragment
=>
!!
maybeCtx
&&
maybeCtx
.
__typename
===
'
Community
'
)
...
...
@@ -33,7 +32,7 @@ export const FeaturedCommunities: FC<FeaturedCommunities> = () => {
()
=>
({
community
,
done
})
=>
{
const
communityFeature
=
featuredCommunitiesPage
.
edges
.
find
(
feature
=>
feature
.
context
?.
__typename
===
'
Community
'
&&
//FIXME: remove ? when fixed
feature
.
context
?.
__typename
===
'
Community
'
&&
feature
.
context
.
id
===
community
.
id
);
const
featureId
=
communityFeature
?.
id
;
...
...
src/fe/community/myFollowed/myFollowedCommunities.ts
View file @
eda95916
...
...
@@ -3,18 +3,18 @@ import * as GQL from './myFollowedCommunities.generated';
import
{
usePage
}
from
'
fe/lib/helpers/usePage
'
;
// import { DEFAULT_PAGE_SIZE } from 'mn-constants';
const
MY_JOIN
M
ED_LIST_LIMIT
=
10
;
// TODO CONFIGURE
const
SIDEBAR_
MY_JOINED_LIST_LIMIT
=
10
;
export
const
useMyFollowedCommunities
=
()
=>
{
const
myFlwCommunitiesQ
=
GQL
.
useMyCommunityFollowsQuery
({
variables
:
{
limit
:
MY_JOIN
M
ED_LIST_LIMIT
}
variables
:
{
limit
:
SIDEBAR_
MY_JOINED_LIST_LIMIT
}
});
const
myCommunityFollowsPage
=
usePage
(
myFlwCommunitiesQ
.
data
?.
me
?.
user
.
communityFollows
,
({
cursor
,
update
})
=>
{
return
myFlwCommunitiesQ
.
fetchMore
({
variables
:
{
...
cursor
,
limit
:
MY_JOIN
M
ED_LIST_LIMIT
},
variables
:
{
...
cursor
,
limit
:
SIDEBAR_
MY_JOINED_LIST_LIMIT
},
updateQuery
:
(
prev
,
{
fetchMoreResult
})
=>
{
return
fetchMoreResult
?.
me
?.
user
?.
communityFollows
&&
prev
.
me
?.
user
?.
communityFollows
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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