about summary refs log tree commit diff
path: root/src/view/com/lists
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2024-08-02 13:05:33 -0500
committerGitHub <noreply@github.com>2024-08-02 13:05:33 -0500
commitc3d8beee6dc141ced2c41795f90b3309a2bc75a2 (patch)
treee2aa55a6e79616ec989b7426e2c46b4cd56b91e2 /src/view/com/lists
parent293ac6fab21f26baa8347c998f3a50224112c7c5 (diff)
downloadvoidsky-c3d8beee6dc141ced2c41795f90b3309a2bc75a2.tar.zst
Respect labels on feeds and lists (#4818)
* Prep

* Pass in optional moderation to FeedCard

* Compute moderation decision, filter contentList contexts, pass into card

* Let's go a different route

* Filter from within search queries

* Use same search query for starter packs

* Filter lists from profile tabs

* Cleanup

* Filter from profile feeds

* Moderate post embeds

* Memoize

* Use ScreenHider on lists

* Hide both list types

* Fix crash on iOS in screen hider, fix lineheight

* Memoize renderItem

* Reuse objects to prevent re-renders
Diffstat (limited to 'src/view/com/lists')
-rw-r--r--src/view/com/lists/ProfileLists.tsx9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/view/com/lists/ProfileLists.tsx b/src/view/com/lists/ProfileLists.tsx
index dc385d436..f633774c7 100644
--- a/src/view/com/lists/ProfileLists.tsx
+++ b/src/view/com/lists/ProfileLists.tsx
@@ -75,12 +75,7 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
         items = items.concat([EMPTY])
       } else if (data?.pages) {
         for (const page of data?.pages) {
-          items = items.concat(
-            page.lists.map(l => ({
-              ...l,
-              _reactKey: l.uri,
-            })),
-          )
+          items = items.concat(page.lists)
         }
       }
       if (isError && !isEmpty) {
@@ -192,7 +187,7 @@ export const ProfileLists = React.forwardRef<SectionRef, ProfileListsProps>(
           testID={testID ? `${testID}-flatlist` : undefined}
           ref={scrollElRef}
           data={items}
-          keyExtractor={(item: any) => item._reactKey}
+          keyExtractor={(item: any) => item._reactKey || item.uri}
           renderItem={renderItemInner}
           refreshing={isPTRing}
           onRefresh={onRefresh}