Use asPredicate
This commit is contained in:
@@ -4,6 +4,7 @@ import {
|
|||||||
AppBskyEmbedRecordWithMedia,
|
AppBskyEmbedRecordWithMedia,
|
||||||
AppBskyFeedDefs,
|
AppBskyFeedDefs,
|
||||||
AppBskyFeedPostgate,
|
AppBskyFeedPostgate,
|
||||||
|
asPredicate,
|
||||||
AtUri,
|
AtUri,
|
||||||
BskyAgent,
|
BskyAgent,
|
||||||
} from '@atproto/api'
|
} from '@atproto/api'
|
||||||
@@ -60,7 +61,10 @@ export async function getPostgateRecord({
|
|||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
|
|
||||||
if (data.value && AppBskyFeedPostgate.isValidRecord(data.value)) {
|
if (
|
||||||
|
data.value &&
|
||||||
|
asPredicate(AppBskyFeedPostgate.validateRecord)(data.value)
|
||||||
|
) {
|
||||||
return data.value
|
return data.value
|
||||||
} else {
|
} else {
|
||||||
return undefined
|
return undefined
|
||||||
|
|||||||
Reference in New Issue
Block a user