From 65ceaed5382cfe93ddfabfccc4a431297aed48c9 Mon Sep 17 00:00:00 2001 From: Elias Nahum Date: Wed, 23 Mar 2022 09:05:20 -0300 Subject: [PATCH] PR feedback --- .../categories/body/channel/channel_list_item.tsx | 2 +- app/components/channel_list/categories/body/index.ts | 4 ++-- .../__snapshots__/thread_overview.test.tsx.snap | 4 ++-- .../post_list/thread_overview/thread_overview.test.tsx | 2 -- app/components/post_list/thread_overview/thread_overview.tsx | 2 +- 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/app/components/channel_list/categories/body/channel/channel_list_item.tsx b/app/components/channel_list/categories/body/channel/channel_list_item.tsx index 6a3e923544..d1da82f9c0 100644 --- a/app/components/channel_list/categories/body/channel/channel_list_item.tsx +++ b/app/components/channel_list/categories/body/channel/channel_list_item.tsx @@ -65,7 +65,7 @@ const ChannelListItem = ({channel, isActive, isOwnDirectMessage, isMuted, myChan const serverUrl = useServerUrl(); // Make it brighter if it's not muted, and highlighted or has unreads - const bright = !isMuted && (myChannel?.isUnread || (myChannel?.mentionsCount ?? 0) > 0); + const bright = !isMuted && myChannel && (myChannel.isUnread || myChannel.mentionsCount > 0); const sharedValue = useSharedValue(collapsed && !bright); diff --git a/app/components/channel_list/categories/body/index.ts b/app/components/channel_list/categories/body/index.ts index 9acf7d37ec..49e2b2de05 100644 --- a/app/components/channel_list/categories/body/index.ts +++ b/app/components/channel_list/categories/body/index.ts @@ -88,7 +88,7 @@ const enhance = withObservables(['category'], ({category, locale, database}: {ca switchMap((c) => getSortedIds(database, c, locale)), ); - let limit = of$(0); + let limit = of$(20); if (category.type === 'direct_messages') { limit = database.get(PREFERENCE). query( @@ -101,7 +101,7 @@ const enhance = withObservables(['category'], ({category, locale, database}: {ca return of$(parseInt(val[0].value, 10)); } - return of$(0); + return of$(20); }, ), ); diff --git a/app/components/post_list/thread_overview/__snapshots__/thread_overview.test.tsx.snap b/app/components/post_list/thread_overview/__snapshots__/thread_overview.test.tsx.snap index 9d1f436185..cdd724cce2 100644 --- a/app/components/post_list/thread_overview/__snapshots__/thread_overview.test.tsx.snap +++ b/app/components/post_list/thread_overview/__snapshots__/thread_overview.test.tsx.snap @@ -16,7 +16,7 @@ exports[`ThreadOverview should match snapshot when post is not saved and 0 repli Object { "borderBottomWidth": 0, }, - Object {}, + undefined, ] } testID="thread-overview" @@ -121,7 +121,7 @@ exports[`ThreadOverview should match snapshot when post is saved and has replies "paddingHorizontal": 20, "paddingVertical": 10, }, - Object {}, + undefined, ] } testID="thread-overview" diff --git a/app/components/post_list/thread_overview/thread_overview.test.tsx b/app/components/post_list/thread_overview/thread_overview.test.tsx index 80ace64270..4ebceffa40 100644 --- a/app/components/post_list/thread_overview/thread_overview.test.tsx +++ b/app/components/post_list/thread_overview/thread_overview.test.tsx @@ -16,7 +16,6 @@ describe('ThreadOverview', () => { repliesCount: 0, rootPost: {} as PostModel, testID: 'thread-overview', - style: {}, }; const wrapper = renderWithIntl(); @@ -29,7 +28,6 @@ describe('ThreadOverview', () => { repliesCount: 2, rootPost: {} as PostModel, testID: 'thread-overview', - style: {}, }; const wrapper = renderWithIntl(); diff --git a/app/components/post_list/thread_overview/thread_overview.tsx b/app/components/post_list/thread_overview/thread_overview.tsx index 60bdaef72f..ddcd6b13dd 100644 --- a/app/components/post_list/thread_overview/thread_overview.tsx +++ b/app/components/post_list/thread_overview/thread_overview.tsx @@ -25,7 +25,7 @@ type Props = { repliesCount: number; rootPost?: PostModel; testID: string; - style: StyleProp; + style?: StyleProp; }; const getStyleSheet = makeStyleSheetFromTheme((theme: Theme) => {