Use asPredicate

This commit is contained in:
Eric Bailey
2025-02-05 11:06:00 -06:00
parent df5c9be1d2
commit 62ecada300
+5 -1
View File
@@ -2,6 +2,7 @@ import {
AppBskyFeedDefs,
AppBskyFeedGetPostThread,
AppBskyFeedThreadgate,
asPredicate,
AtUri,
BskyAgent,
} from '@atproto/api'
@@ -138,7 +139,10 @@ export async function getThreadgateRecord({
}),
)
if (data.value && AppBskyFeedThreadgate.isValidRecord(data.value)) {
if (
data.value &&
asPredicate(AppBskyFeedThreadgate.validateRecord)(data.value)
) {
return data.value
} else {
return null