Remove remaining usages of old post thread query (#9184)
* Remove remaining usages of old post thread query * Add PostThreadContext, cache mutator for threadgates on threads, pipe it through * Replace getPostThread in threadgate query * Replace in initQuote handling, which isn't even used rn... * Missing import * Revert ext change
This commit is contained in:
@@ -7,7 +7,7 @@ import {
|
||||
type NativeStackScreenProps,
|
||||
} from '#/lib/routes/types'
|
||||
import {makeRecordUri} from '#/lib/strings/url-helpers'
|
||||
import {usePostThreadQuery} from '#/state/queries/post-thread'
|
||||
import {usePostQuery} from '#/state/queries/post'
|
||||
import {useSetMinimalShellMode} from '#/state/shell'
|
||||
import {PostLikedBy as PostLikedByComponent} from '#/view/com/post-thread/PostLikedBy'
|
||||
import * as Layout from '#/components/Layout'
|
||||
@@ -17,11 +17,11 @@ export const PostLikedByScreen = ({route}: Props) => {
|
||||
const setMinimalShellMode = useSetMinimalShellMode()
|
||||
const {name, rkey} = route.params
|
||||
const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey)
|
||||
const {data: post} = usePostThreadQuery(uri)
|
||||
const {data: post} = usePostQuery(uri)
|
||||
|
||||
let likeCount
|
||||
if (post?.thread.type === 'post') {
|
||||
likeCount = post.thread.post.likeCount
|
||||
if (post) {
|
||||
likeCount = post.likeCount
|
||||
}
|
||||
|
||||
useFocusEffect(
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
type NativeStackScreenProps,
|
||||
} from '#/lib/routes/types'
|
||||
import {makeRecordUri} from '#/lib/strings/url-helpers'
|
||||
import {usePostThreadQuery} from '#/state/queries/post-thread'
|
||||
import {usePostQuery} from '#/state/queries/post'
|
||||
import {useSetMinimalShellMode} from '#/state/shell'
|
||||
import {PostQuotes as PostQuotesComponent} from '#/view/com/post-thread/PostQuotes'
|
||||
import * as Layout from '#/components/Layout'
|
||||
@@ -17,11 +17,11 @@ export const PostQuotesScreen = ({route}: Props) => {
|
||||
const setMinimalShellMode = useSetMinimalShellMode()
|
||||
const {name, rkey} = route.params
|
||||
const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey)
|
||||
const {data: post} = usePostThreadQuery(uri)
|
||||
const {data: post} = usePostQuery(uri)
|
||||
|
||||
let quoteCount
|
||||
if (post?.thread.type === 'post') {
|
||||
quoteCount = post.thread.post.quoteCount
|
||||
if (post) {
|
||||
quoteCount = post.quoteCount
|
||||
}
|
||||
|
||||
useFocusEffect(
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
type NativeStackScreenProps,
|
||||
} from '#/lib/routes/types'
|
||||
import {makeRecordUri} from '#/lib/strings/url-helpers'
|
||||
import {usePostThreadQuery} from '#/state/queries/post-thread'
|
||||
import {usePostQuery} from '#/state/queries/post'
|
||||
import {useSetMinimalShellMode} from '#/state/shell'
|
||||
import {PostRepostedBy as PostRepostedByComponent} from '#/view/com/post-thread/PostRepostedBy'
|
||||
import * as Layout from '#/components/Layout'
|
||||
@@ -17,11 +17,11 @@ export const PostRepostedByScreen = ({route}: Props) => {
|
||||
const {name, rkey} = route.params
|
||||
const uri = makeRecordUri(name, 'app.bsky.feed.post', rkey)
|
||||
const setMinimalShellMode = useSetMinimalShellMode()
|
||||
const {data: post} = usePostThreadQuery(uri)
|
||||
const {data: post} = usePostQuery(uri)
|
||||
|
||||
let quoteCount
|
||||
if (post?.thread.type === 'post') {
|
||||
quoteCount = post.thread.post.repostCount
|
||||
if (post) {
|
||||
quoteCount = post.repostCount
|
||||
}
|
||||
|
||||
useFocusEffect(
|
||||
|
||||
Reference in New Issue
Block a user