From df5c9be1d2a0778913a9a511aaa1fd3f22931c69 Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Wed, 5 Feb 2025 11:05:21 -0600 Subject: [PATCH] Use asPredicate --- src/state/queries/threadgate/util.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/state/queries/threadgate/util.ts b/src/state/queries/threadgate/util.ts index 75c1bdef1a..452fc84c79 100644 --- a/src/state/queries/threadgate/util.ts +++ b/src/state/queries/threadgate/util.ts @@ -1,4 +1,4 @@ -import {AppBskyFeedDefs, AppBskyFeedThreadgate} from '@atproto/api' +import {AppBskyFeedDefs, AppBskyFeedThreadgate, asPredicate} from '@atproto/api' import {ThreadgateAllowUISetting} from '#/state/queries/threadgate/types' @@ -7,7 +7,8 @@ export function threadgateViewToAllowUISetting( ): ThreadgateAllowUISetting[] { // Validate the record for clarity, since backwards compat code is a little confusing const threadgate = - threadgateView && AppBskyFeedThreadgate.isValidRecord(threadgateView.record) + threadgateView && + asPredicate(AppBskyFeedThreadgate.validateRecord)(threadgateView.record) ? threadgateView.record : undefined return threadgateRecordToAllowUISetting(threadgate)