From a4e4e12d570d8e6c1ae468c81cacd689e809be3e Mon Sep 17 00:00:00 2001 From: Eric Bailey Date: Mon, 6 Jan 2025 16:05:03 -0600 Subject: [PATCH] Cast for perf reasons --- src/state/queries/notifications/util.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/state/queries/notifications/util.ts b/src/state/queries/notifications/util.ts index b41c50d586..e5f957ec2b 100644 --- a/src/state/queries/notifications/util.ts +++ b/src/state/queries/notifications/util.ts @@ -255,11 +255,14 @@ function getSubjectUri( return notif.uri } else if (type === 'post-like' || type === 'repost') { if ( - AppBskyFeedRepost.isValidRecord(notif.record) || - AppBskyFeedLike.isValidRecord(notif.record) + AppBskyFeedRepost.isRecord(notif.record) || + AppBskyFeedLike.isRecord(notif.record) ) { - return typeof notif.record.subject?.uri === 'string' - ? notif.record.subject?.uri + const record = notif.record as + | AppBskyFeedRepost.Record + | AppBskyFeedLike.Record + return typeof record.subject?.uri === 'string' + ? record.subject?.uri : undefined } } else if (type === 'feedgen-like') {