Notifications: Fix missing sound when notifications are not permitted (#1555)
This commit is contained in:
parent
50db2eea77
commit
a23e951b09
@ -322,12 +322,13 @@ export async function notifyAboutNewMessage({
|
|||||||
}: { chat: ApiChat; message: Partial<ApiMessage> }) {
|
}: { chat: ApiChat; message: Partial<ApiMessage> }) {
|
||||||
const { hasWebNotifications } = await loadNotificationSettings();
|
const { hasWebNotifications } = await loadNotificationSettings();
|
||||||
if (!checkIfShouldNotify(chat)) return;
|
if (!checkIfShouldNotify(chat)) return;
|
||||||
if (!hasWebNotifications) {
|
const areNotificationsSupported = checkIfNotificationsSupported();
|
||||||
|
if (!hasWebNotifications || !areNotificationsSupported) {
|
||||||
// only play sound if web notifications are disabled
|
// only play sound if web notifications are disabled
|
||||||
playNotifySoundDebounced(String(message.id) || chat.id);
|
playNotifySoundDebounced(String(message.id) || chat.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!checkIfNotificationsSupported()) return;
|
if (!areNotificationsSupported) return;
|
||||||
if (!message.id) return;
|
if (!message.id) return;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user