Commit eda95916 authored by aleclofabbro's avatar aleclofabbro

Merge branch 'cleanup/removed_some_todo_fixme_comments' into develop

parents ed6aa11b 363ae937
......@@ -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;
......
......@@ -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;
......
......@@ -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_JOINMED_LIST_LIMIT = 10; // TODO CONFIGURE
const SIDEBAR_MY_JOINED_LIST_LIMIT = 10;
export const useMyFollowedCommunities = () => {
const myFlwCommunitiesQ = GQL.useMyCommunityFollowsQuery({
variables: { limit: MY_JOINMED_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_JOINMED_LIST_LIMIT },
variables: { ...cursor, limit: SIDEBAR_MY_JOINED_LIST_LIMIT },
updateQuery: (prev, { fetchMoreResult }) => {
return fetchMoreResult?.me?.user?.communityFollows &&
prev.me?.user?.communityFollows
......
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