From 7341471ce7276630982649bdc93b14d90a78e2c6 Mon Sep 17 00:00:00 2001 From: Mikunj Date: Tue, 15 Jan 2019 15:41:14 +1100 Subject: [PATCH] Fix up notification. --- js/models/conversations.js | 1 + js/notifications.js | 11 +++++++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/js/models/conversations.js b/js/models/conversations.js index 7a6963abb..af8ce2409 100644 --- a/js/models/conversations.js +++ b/js/models/conversations.js @@ -2166,6 +2166,7 @@ messageSentAt: Date.now(), title: i18n(title), isFriendRequest: true, + friendRequestType: type, }); }, diff --git a/js/notifications.js b/js/notifications.js index 4a3d0bb59..97c1766bf 100644 --- a/js/notifications.js +++ b/js/notifications.js @@ -100,8 +100,15 @@ const last = this.last().toJSON(); switch (userSetting) { case SettingNames.COUNT: - title = 'Signal'; - message = newMessageCountLabel; + title = 'Loki Messenger'; + + if (messagesNotificationCount > 0) { + message = newMessageCountLabel; + } else if (last.isFriendRequest) { + message = `Friend request ${last.friendRequestType}`; + } else { + message = '-'; + } break; case SettingNames.NAME: { const lastMessageTitle = last.title;