Replace in initQuote handling, which isn't even used rn...
This commit is contained in:
@@ -44,9 +44,8 @@ import Animated, {
|
|||||||
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
import {useSafeAreaInsets} from 'react-native-safe-area-context'
|
||||||
import {type ImagePickerAsset} from 'expo-image-picker'
|
import {type ImagePickerAsset} from 'expo-image-picker'
|
||||||
import {
|
import {
|
||||||
AppBskyFeedDefs,
|
|
||||||
type AppBskyFeedGetPostThread,
|
|
||||||
AppBskyUnspeccedDefs,
|
AppBskyUnspeccedDefs,
|
||||||
|
type AppBskyUnspeccedGetPostThreadV2,
|
||||||
AtUri,
|
AtUri,
|
||||||
type BskyAgent,
|
type BskyAgent,
|
||||||
type RichText,
|
type RichText,
|
||||||
@@ -549,10 +548,10 @@ export const ComposePost = ({
|
|||||||
if (initQuote) {
|
if (initQuote) {
|
||||||
// We want to wait for the quote count to update before we call `onPost`, which will refetch data
|
// We want to wait for the quote count to update before we call `onPost`, which will refetch data
|
||||||
whenAppViewReady(agent, initQuote.uri, res => {
|
whenAppViewReady(agent, initQuote.uri, res => {
|
||||||
const quotedThread = res.data.thread
|
const anchor = res.data.thread.at(0)
|
||||||
if (
|
if (
|
||||||
AppBskyFeedDefs.isThreadViewPost(quotedThread) &&
|
AppBskyUnspeccedDefs.isThreadItemPost(anchor?.value) &&
|
||||||
quotedThread.post.quoteCount !== initQuote.quoteCount
|
anchor.value.post.quoteCount !== initQuote.quoteCount
|
||||||
) {
|
) {
|
||||||
onPost?.(postUri)
|
onPost?.(postUri)
|
||||||
onPostSuccess?.(postSuccessData)
|
onPostSuccess?.(postSuccessData)
|
||||||
@@ -1661,16 +1660,18 @@ function useKeyboardVerticalOffset() {
|
|||||||
async function whenAppViewReady(
|
async function whenAppViewReady(
|
||||||
agent: BskyAgent,
|
agent: BskyAgent,
|
||||||
uri: string,
|
uri: string,
|
||||||
fn: (res: AppBskyFeedGetPostThread.Response) => boolean,
|
fn: (res: AppBskyUnspeccedGetPostThreadV2.Response) => boolean,
|
||||||
) {
|
) {
|
||||||
await until(
|
await until(
|
||||||
5, // 5 tries
|
5, // 5 tries
|
||||||
1e3, // 1s delay between tries
|
1e3, // 1s delay between tries
|
||||||
fn,
|
fn,
|
||||||
() =>
|
() =>
|
||||||
agent.app.bsky.feed.getPostThread({
|
agent.app.bsky.unspecced.getPostThreadV2({
|
||||||
uri,
|
anchor: uri,
|
||||||
depth: 0,
|
above: false,
|
||||||
|
below: 0,
|
||||||
|
branchingFactor: 0,
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user