Clean up types, leave validation in critical path
This commit is contained in:
@@ -55,16 +55,15 @@ export class FeedViewPostsSlice {
|
|||||||
}
|
}
|
||||||
this._feedPost = feedPost
|
this._feedPost = feedPost
|
||||||
this._reactKey = `slice-${post.uri}-${
|
this._reactKey = `slice-${post.uri}-${
|
||||||
feedPost.reason?.indexedAt || post.indexedAt
|
feedPost.reason && 'indexedAt' in feedPost.reason
|
||||||
|
? feedPost.reason.indexedAt
|
||||||
|
: post.indexedAt
|
||||||
}`
|
}`
|
||||||
if (feedPost.post.uri === FALLBACK_MARKER_POST.post.uri) {
|
if (feedPost.post.uri === FALLBACK_MARKER_POST.post.uri) {
|
||||||
this.isFallbackMarker = true
|
this.isFallbackMarker = true
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (
|
if (!AppBskyFeedPost.isValidRecord(post.record)) {
|
||||||
!AppBskyFeedPost.isRecord(post.record) ||
|
|
||||||
!AppBskyFeedPost.validateRecord(post.record).success
|
|
||||||
) {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const parent = reply?.parent
|
const parent = reply?.parent
|
||||||
@@ -94,8 +93,7 @@ export class FeedViewPostsSlice {
|
|||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
!AppBskyFeedDefs.isPostView(parent) ||
|
!AppBskyFeedDefs.isPostView(parent) ||
|
||||||
!AppBskyFeedPost.isRecord(parent.record) ||
|
!AppBskyFeedPost.isValidRecord(parent.record)
|
||||||
!AppBskyFeedPost.validateRecord(parent.record).success
|
|
||||||
) {
|
) {
|
||||||
this.isOrphan = true
|
this.isOrphan = true
|
||||||
return
|
return
|
||||||
@@ -136,8 +134,7 @@ export class FeedViewPostsSlice {
|
|||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
!AppBskyFeedDefs.isPostView(root) ||
|
!AppBskyFeedDefs.isPostView(root) ||
|
||||||
!AppBskyFeedPost.isRecord(root.record) ||
|
!AppBskyFeedPost.isValidRecord(root.record)
|
||||||
!AppBskyFeedPost.validateRecord(root.record).success
|
|
||||||
) {
|
) {
|
||||||
this.isOrphan = true
|
this.isOrphan = true
|
||||||
return
|
return
|
||||||
|
|||||||
Reference in New Issue
Block a user