From 9c0c18d5d08db6433fbee8412c2c4da400a31afa Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Fri, 8 Dec 2023 18:29:53 -0600 Subject: [PATCH] Use new filter for Posts tab on profile (#2150) * Use new filter for Posts tab on profile * Update deps * Remove log --- package.json | 4 +- src/lib/api/feed/author.ts | 2 +- src/state/queries/post-feed.ts | 1 + src/view/com/posts/Feed.tsx | 2 +- src/view/screens/Profile.tsx | 2 +- yarn.lock | 141 +++++++-------------------------- 6 files changed, 35 insertions(+), 117 deletions(-) diff --git a/package.json b/package.json index 070d1cc5..feb48778 100644 --- a/package.json +++ b/package.json @@ -35,7 +35,7 @@ "intl:compile": "lingui compile" }, "dependencies": { - "@atproto/api": "^0.7.0", + "@atproto/api": "^0.7.2", "@bam.tech/react-native-image-resizer": "^3.0.4", "@braintree/sanitize-url": "^6.0.2", "@emoji-mart/react": "^1.1.1", @@ -169,7 +169,7 @@ "zod": "^3.20.2" }, "devDependencies": { - "@atproto/dev-env": "^0.2.16", + "@atproto/dev-env": "^0.2.19", "@babel/core": "^7.23.2", "@babel/preset-env": "^7.20.0", "@babel/runtime": "^7.20.0", diff --git a/src/lib/api/feed/author.ts b/src/lib/api/feed/author.ts index 74af383d..57db061b 100644 --- a/src/lib/api/feed/author.ts +++ b/src/lib/api/feed/author.ts @@ -40,7 +40,7 @@ export class AuthorFeedAPI implements FeedAPI { } _filter(feed: AppBskyFeedDefs.FeedViewPost[]) { - if (this.params.filter === 'posts_no_replies') { + if (this.params.filter === 'posts_and_author_threads') { return feed.filter(post => { const isReply = post.reply const isRepost = AppBskyFeedDefs.isReasonRepost(post.reason) diff --git a/src/state/queries/post-feed.ts b/src/state/queries/post-feed.ts index 14ffeb0d..7847c720 100644 --- a/src/state/queries/post-feed.ts +++ b/src/state/queries/post-feed.ts @@ -35,6 +35,7 @@ type ActorDid = string type AuthorFilter = | 'posts_with_replies' | 'posts_no_replies' + | 'posts_and_author_threads' | 'posts_with_media' type FeedUri = string type ListUri = string diff --git a/src/view/com/posts/Feed.tsx b/src/view/com/posts/Feed.tsx index 43f327c0..fe619ab3 100644 --- a/src/view/com/posts/Feed.tsx +++ b/src/view/com/posts/Feed.tsx @@ -121,7 +121,7 @@ let Feed = ({ data?.pages.length === 1 && (feed === 'following' || feed === 'home' || - feed === `author|${myDid}|posts_no_replies`) + feed === `author|${myDid}|posts_and_author_threads`) ) { queryClient.invalidateQueries({queryKey: RQKEY(feed)}) } diff --git a/src/view/screens/Profile.tsx b/src/view/screens/Profile.tsx index ae527038..e019c4ed 100644 --- a/src/view/screens/Profile.tsx +++ b/src/view/screens/Profile.tsx @@ -280,7 +280,7 @@ function ProfileScreenLoaded({ {({onScroll, headerHeight, isFocused, isScrolledDown, scrollElRef}) => (