Add browser notifications sound (#8515)

Signed-off-by: Anton Alexeyev <alexeyev.anton@gmail.com>
This commit is contained in:
utkaka
2025-04-10 19:47:48 +05:00
committed by GitHub
parent 601fabd712
commit afbaf26078
11 changed files with 77 additions and 27 deletions
@@ -7,10 +7,10 @@
import chunter, { ThreadMessage } from '@hcengineering/chunter'
import { getResource } from '@hcengineering/platform'
import activity, { ActivityMessage } from '@hcengineering/activity'
import { getClient } from '@hcengineering/presentation'
import { getClient, playSound } from '@hcengineering/presentation'
import { pushAvailable, subscribePush } from '../utils'
import plugin from '../plugin'
import { onMount } from 'svelte'
export let notification: PlatformNotification
export let onRemove: () => void
@@ -54,6 +54,11 @@
const fn = await getResource(chunter.function.OpenChannelInSidebar)
await fn(_id, _class, undefined, thread, true, selectedMessageId)
}
onMount(async () => {
if (!value.soundAlert) return
await playSound(plugin.sound.InboxNotification)
})
</script>
<NotificationToast title={notification.title} severity={notification.severity} onClose={onRemove}>