Notifications: Temporarily turn off sound for reactions (#1808)

This commit is contained in:
Alexander Zinchuk 2022-04-01 20:43:51 +02:00
parent 5b7bda0931
commit e54bf92a1f
3 changed files with 5 additions and 1 deletions

View File

@ -137,6 +137,7 @@ addActionHandler('apiUpdate', (global, actions, update) => {
notifyAboutMessage({
chat,
message,
isReaction: true,
});
}

View File

@ -129,7 +129,8 @@ function showNotification({
};
return Promise.all([
playNotificationSound(String(messageId) || chatId || ''),
// TODO Remove condition when reaction badges are implemented
!reaction ? playNotificationSound(String(messageId) || chatId || '') : undefined,
self.registration.showNotification(title, options),
]);
}

View File

@ -409,6 +409,8 @@ export async function notifyAboutMessage({
// Play sound when notification is displayed
notification.onshow = () => {
// TODO Remove when reaction badges are implemented
if (isReaction) return;
playNotifySoundDebounced(String(message.id) || chat.id);
};
}