From 814dfdd69ffd4d7a3b290dc9819ca447adc4ba02 Mon Sep 17 00:00:00 2001 From: Hunter Miller Date: Thu, 11 Jan 2024 14:58:30 -0600 Subject: [PATCH] notification: better dereferencing --- ui/src/nav/notifications/Notification.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/src/nav/notifications/Notification.tsx b/ui/src/nav/notifications/Notification.tsx index c2580045..68ca888e 100644 --- a/ui/src/nav/notifications/Notification.tsx +++ b/ui/src/nav/notifications/Notification.tsx @@ -142,12 +142,12 @@ const NotificationContent: React.FC = ({ type, content, }) => { - const con = content; + const line = (content[1] || '').toString(); const mentionRe = new RegExp('mentioned'); const replyRe = new RegExp('replied'); - const isMention = type === 'channel' && mentionRe.test(content[1].toString()); - const isReply = type === 'channel' && replyRe.test(content[1].toString()); + const isMention = type === 'channel' && mentionRe.test(line); + const isReply = type === 'channel' && replyRe.test(line); function renderContent(c: YarnContent) { if (typeof c === 'string') {