diff --git a/Session/Notifications/AppNotifications.swift b/Session/Notifications/AppNotifications.swift index e0c25749b..d6d51b294 100644 --- a/Session/Notifications/AppNotifications.swift +++ b/Session/Notifications/AppNotifications.swift @@ -320,14 +320,23 @@ public class NotificationPresenter: NSObject, NotificationsProtocol { closedGroupName: nil, // Not supported openGroupName: nil // Not supported ) - var notificationBody: String? + let notificationBody: String? = { + switch messageInfo.state { + case .permissionDenied: + return String( + format: "modal_call_missed_tips_explanation".localized(), + threadName + ) + case .missed: + return String( + format: "call_missed".localized(), + threadName + ) + default: + return nil + } + }() - if messageInfo.state == .permissionDenied { - notificationBody = String( - format: "modal_call_missed_tips_explanation".localized(), - threadName - ) - } let fallbackSound: Preferences.Sound = db[.defaultNotificationSound] .defaulting(to: Preferences.Sound.defaultNotificationSound)