mirror of
https://github.com/duckietm/Nitro-V3.git
synced 2026-06-19 15:06:20 +00:00
feat(mentions): use dedicated mention chime sample
This commit is contained in:
@@ -1,10 +1,13 @@
|
|||||||
import { MentionReceivedEvent, MentionsListEvent, RequestMentionsComposer } from '@nitrots/nitro-renderer';
|
import { MentionReceivedEvent, MentionsListEvent, RequestMentionsComposer } from '@nitrots/nitro-renderer';
|
||||||
import { useCallback, useEffect } from 'react';
|
import { useCallback, useEffect } from 'react';
|
||||||
import { GetConfigurationValue, IMentionEntry, LocalizeText, NotificationBubbleType, PlaySound, SendMessageComposer, SoundNames } from '../../api';
|
import { GetConfigurationValue, IMentionEntry, LocalizeText, NotificationBubbleType, PlaySound, SendMessageComposer } from '../../api';
|
||||||
import { useMessageEvent } from '../events';
|
import { useMessageEvent } from '../events';
|
||||||
import { useNotificationActions } from '../notification';
|
import { useNotificationActions } from '../notification';
|
||||||
import { addMention, setMentions } from './mentionsStore';
|
import { addMention, setMentions } from './mentionsStore';
|
||||||
|
|
||||||
|
// Dedicated mention chime served from nitro-assets/sounds/<sample>.mp3.
|
||||||
|
const MENTION_SOUND_SAMPLE = 'mentions_notification';
|
||||||
|
|
||||||
export const useMentionMessages = (): void =>
|
export const useMentionMessages = (): void =>
|
||||||
{
|
{
|
||||||
const { showSingleBubble } = useNotificationActions();
|
const { showSingleBubble } = useNotificationActions();
|
||||||
@@ -46,7 +49,7 @@ export const useMentionMessages = (): void =>
|
|||||||
|
|
||||||
addMention(entry);
|
addMention(entry);
|
||||||
|
|
||||||
if(GetConfigurationValue<boolean>('mentions_ui.sound', true)) PlaySound(SoundNames.MESSENGER_MESSAGE_RECEIVED);
|
if(GetConfigurationValue<boolean>('mentions_ui.sound', true)) PlaySound(MENTION_SOUND_SAMPLE);
|
||||||
|
|
||||||
showSingleBubble(
|
showSingleBubble(
|
||||||
LocalizeText('mentions.notification', [ 'sender', 'room' ], [ entry.senderUsername, entry.roomName ]),
|
LocalizeText('mentions.notification', [ 'sender', 'room' ], [ entry.senderUsername, entry.roomName ]),
|
||||||
|
|||||||
Reference in New Issue
Block a user