Skip to content

Commit

Permalink
Merge pull request #251 from tloncorp/hm/allow-notifications-with-sin…
Browse files Browse the repository at this point in the history
…gle-contents

notification: prevent notification with single piece of content from crashing
  • Loading branch information
arthyn authored Jan 16, 2024
2 parents 1088a24 + 814dfdd commit da1d1fd
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions ui/src/nav/notifications/Notification.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -142,12 +142,12 @@ const NotificationContent: React.FC<NotificationContent> = ({
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') {
Expand Down

0 comments on commit da1d1fd

Please sign in to comment.