diff --git a/src/state/queries/threadgate/index.ts b/src/state/queries/threadgate/index.ts index b72ab7de24..e7ec3689e1 100644 --- a/src/state/queries/threadgate/index.ts +++ b/src/state/queries/threadgate/index.ts @@ -49,7 +49,7 @@ export async function getThreadgateRecord({ }: { agent: BskyAgent postUri: string -}): Promise { +}): Promise { const urip = new AtUri(postUri) if (!urip.host.startsWith('did:')) { @@ -71,11 +71,11 @@ export async function getThreadgateRecord({ if (data.value && AppBskyFeedThreadgate.isRecord(data.value)) { return data.value } else { - return undefined + return null } } catch (e: any) { if (e.message.includes(`Could not locate record:`)) { - return undefined + return null } else { throw new Error(`Failed to get threadgate record`, {cause: e}) } @@ -117,7 +117,7 @@ export async function upsertThreadgate( postUri: string }, callback: ( - threadgate: AppBskyFeedThreadgate.Record | undefined, + threadgate: AppBskyFeedThreadgate.Record | null, ) => Promise, ) { const prev = await getThreadgateRecord({ diff --git a/src/view/com/post-thread/PostThread.tsx b/src/view/com/post-thread/PostThread.tsx index a7be1f34c9..9655ea17d5 100644 --- a/src/view/com/post-thread/PostThread.tsx +++ b/src/view/com/post-thread/PostThread.tsx @@ -187,7 +187,7 @@ export function PostThread({ treeView, threadModerationCache, hiddenRepliesState !== HiddenRepliesState.Hide, - threadgateRecord, + threadgateRecord || undefined, ) }, [ thread,