cast branded params with the dedicated syntax types
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import {useCallback, useMemo, useState} from 'react'
|
||||
import {type AtUriString} from '@atproto/syntax'
|
||||
import {useQuery, useQueryClient} from '@tanstack/react-query'
|
||||
|
||||
import {useModerationOpts} from '#/state/preferences/moderation-opts'
|
||||
@@ -73,7 +74,7 @@ export function usePostThread({anchor}: {anchor?: string}) {
|
||||
queryKey: postThreadQueryKey,
|
||||
async queryFn(ctx) {
|
||||
const data = await client.call(app.bsky.unspecced.getPostThreadV2, {
|
||||
anchor: anchor! as app.bsky.unspecced.getPostThreadV2.$Params['anchor'],
|
||||
anchor: anchor! as AtUriString,
|
||||
branchingFactor: view === 'linear' ? LINEAR_VIEW_BF : TREE_VIEW_BF,
|
||||
below,
|
||||
sort: sort,
|
||||
@@ -169,8 +170,7 @@ export function usePostThread({anchor}: {anchor?: string}) {
|
||||
queryKey: postThreadOtherQueryKey,
|
||||
async queryFn() {
|
||||
return await client.call(app.bsky.unspecced.getPostThreadOtherV2, {
|
||||
anchor:
|
||||
anchor! as app.bsky.unspecced.getPostThreadOtherV2.$Params['anchor'],
|
||||
anchor: anchor! as AtUriString,
|
||||
})
|
||||
},
|
||||
})
|
||||
|
||||
@@ -52,6 +52,7 @@ import {
|
||||
type RichText,
|
||||
} from '@atproto/api'
|
||||
import {type Client} from '@atproto/lex'
|
||||
import {type AtUriString} from '@atproto/syntax'
|
||||
import {plural} from '@lingui/core/macro'
|
||||
import {Trans, useLingui} from '@lingui/react/macro'
|
||||
import {useNavigation} from '@react-navigation/native'
|
||||
@@ -1109,8 +1110,7 @@ export const ComposePost = ({
|
||||
const res = await client.call(
|
||||
app.bsky.unspecced.getPostThreadV2,
|
||||
{
|
||||
anchor:
|
||||
postUri! as app.bsky.unspecced.getPostThreadV2.$Params['anchor'],
|
||||
anchor: postUri! as AtUriString,
|
||||
above: false,
|
||||
below: filteredThread.posts.length - 1,
|
||||
branchingFactor: 1,
|
||||
@@ -2502,7 +2502,7 @@ async function whenAppViewReady(
|
||||
fn,
|
||||
() =>
|
||||
client.call(app.bsky.unspecced.getPostThreadV2, {
|
||||
anchor: uri as app.bsky.unspecced.getPostThreadV2.$Params['anchor'],
|
||||
anchor: uri as AtUriString,
|
||||
above: false,
|
||||
below: 0,
|
||||
branchingFactor: 0,
|
||||
|
||||
Reference in New Issue
Block a user