Skip to content

Commit

Permalink
feat(notification): show text, avatar and username in notifications
Browse files Browse the repository at this point in the history
  • Loading branch information
ph1p committed Jan 5, 2021
1 parent 8736898 commit 0b25c6b
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/store/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,10 +190,18 @@ class RootStore {
audio.play();
}
if (this.settings.enableNotificationTooltip) {
let text = '';
if (data.text) {
text =
data.text.length > 25
? data.text.substr(0, 25 - 1) + '...'
: data.text;
}

sendMainMessage(
'notification',
messageData?.user?.name
? `New chat message from ${messageData.user.name}`
? `${text} · ${messageData.user.avatar} ${messageData.user.name}`
: `New chat message`
);
}
Expand Down

0 comments on commit 0b25c6b

Please sign in to comment.