From 26a338f586ac2ed1d812454100a0279b561f4946 Mon Sep 17 00:00:00 2001 From: Paul Frazee Date: Tue, 5 Mar 2024 21:27:47 -0800 Subject: [PATCH] Fix likes dialog on mobile --- src/components/LikesDialog.tsx | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/src/components/LikesDialog.tsx b/src/components/LikesDialog.tsx index 186b102c37..02ea924aef 100644 --- a/src/components/LikesDialog.tsx +++ b/src/components/LikesDialog.tsx @@ -1,5 +1,5 @@ import React, {useMemo, useCallback} from 'react' -import {ActivityIndicator, View} from 'react-native' +import {ActivityIndicator, FlatList, View} from 'react-native' import {msg, Trans} from '@lingui/macro' import {useLingui} from '@lingui/react' import {AppBskyFeedGetLikes as GetLikes} from '@atproto/api' @@ -55,6 +55,7 @@ export function LikesDialogInner({control, uri}: LikesDialogProps) { if (data?.pages) { return data.pages.flatMap(page => page.likes) } + return [] }, [data]) const onEndReached = useCallback(async () => { @@ -92,7 +93,7 @@ export function LikesDialogInner({control, uri}: LikesDialogProps) { ) : resolveError || isError ? ( - ) : likes?.length === 0 ? ( + ) : likes.length === 0 ? ( @@ -100,18 +101,18 @@ export function LikesDialogInner({control, uri}: LikesDialogProps) { - ) : ( - item.actor.did} - onEndReached={onEndReached} - renderItem={renderItem} - initialNumToRender={15} - ListFooterComponent={ - - } - /> - )} + ) : null} + item.actor.did} + onEndReached={onEndReached} + renderItem={renderItem} + initialNumToRender={15} + ListFooterComponent={ + + } + style={{height: 400}} + />