Use asPredicate
This commit is contained in:
@@ -2,6 +2,7 @@ import {
|
|||||||
AppBskyFeedDefs,
|
AppBskyFeedDefs,
|
||||||
AppBskyFeedGetPostThread,
|
AppBskyFeedGetPostThread,
|
||||||
AppBskyFeedThreadgate,
|
AppBskyFeedThreadgate,
|
||||||
|
asPredicate,
|
||||||
AtUri,
|
AtUri,
|
||||||
BskyAgent,
|
BskyAgent,
|
||||||
} from '@atproto/api'
|
} 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
|
return data.value
|
||||||
} else {
|
} else {
|
||||||
return null
|
return null
|
||||||
|
|||||||
Reference in New Issue
Block a user