Cast for perf reasons

This commit is contained in:
Eric Bailey
2025-01-06 16:05:03 -06:00
parent 4cb5cfa8d4
commit 15b9d5af43
+7 -4
View File
@@ -255,11 +255,14 @@ function getSubjectUri(
return notif.uri return notif.uri
} else if (type === 'post-like' || type === 'repost') { } else if (type === 'post-like' || type === 'repost') {
if ( if (
AppBskyFeedRepost.isValidRecord(notif.record) || AppBskyFeedRepost.isRecord(notif.record) ||
AppBskyFeedLike.isValidRecord(notif.record) AppBskyFeedLike.isRecord(notif.record)
) { ) {
return typeof notif.record.subject?.uri === 'string' const record = notif.record as
? notif.record.subject?.uri | AppBskyFeedRepost.Record
| AppBskyFeedLike.Record
return typeof record.subject?.uri === 'string'
? record.subject?.uri
: undefined : undefined
} }
} else if (type === 'feedgen-like') { } else if (type === 'feedgen-like') {