diff --git a/src/state/queries/usePostThread/index.ts b/src/state/queries/usePostThread/index.ts index bdaa42895f..b4e217f4bd 100644 --- a/src/state/queries/usePostThread/index.ts +++ b/src/state/queries/usePostThread/index.ts @@ -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, }) }, }) diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx index 641f651788..6c7c2280c2 100644 --- a/src/view/com/composer/Composer.tsx +++ b/src/view/com/composer/Composer.tsx @@ -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,