From 571fc37a9920d3b7b13a9eed2c46513036f3a4f4 Mon Sep 17 00:00:00 2001 From: Ansh Nanda Date: Thu, 18 May 2023 10:34:34 -0700 Subject: [PATCH 1/2] fix error & empty state when rendering custom feeds on profile --- src/view/screens/Profile.tsx | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index bf312cd0..5f31c89c 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -120,6 +120,7 @@ export const ProfileScreen = withAuthRequired( }, [uiState.showLoadingMoreFooter]) const renderItem = React.useCallback( (item: any) => { + // if section is lists if (uiState.selectedView === Sections.Lists) { if (item === ProfileUiModel.LOADING_ITEM) { return @@ -144,6 +145,32 @@ export const ProfileScreen = withAuthRequired( } else { return } + // if section is custom algorithms + } else if (uiState.selectedView === Sections.CustomAlgorithms) { + if (item === ProfileUiModel.LOADING_ITEM) { + return + } else if (item._reactKey === '__error__') { + return ( + + + + ) + } else if (item === ProfileUiModel.EMPTY_ITEM) { + return ( + + ) + } else if (item instanceof CustomFeedModel) { + return + } + // if section is posts or posts & replies } else { if (item === ProfileUiModel.END_ITEM) { return - end of feed - @@ -188,8 +215,6 @@ export const ProfileScreen = withAuthRequired( return ( ) - } else if (item instanceof CustomFeedModel) { - return } } return From f1d2166c2911456fc60c83eb3204e5d823dff475 Mon Sep 17 00:00:00 2001 From: Ansh Nanda Date: Thu, 18 May 2023 10:36:16 -0700 Subject: [PATCH 2/2] fix spacing when user has no feeds --- src/view/com/feeds/SavedFeeds.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/view/com/feeds/SavedFeeds.tsx b/src/view/com/feeds/SavedFeeds.tsx index 1cb109a4..110a6e89 100644 --- a/src/view/com/feeds/SavedFeeds.tsx +++ b/src/view/com/feeds/SavedFeeds.tsx @@ -104,6 +104,7 @@ const styles = StyleSheet.create({ paddingHorizontal: 26, paddingVertical: 18, gap: 18, + marginTop: 8, }, empty: { paddingHorizontal: 18,