From 51ac1f599c66ac7f7f8b924a25989f98d39a1e12 Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 24 Jun 2021 22:06:30 +0100 Subject: [PATCH] Fix: Notification settings not affecting playSound --- src/context/Settings.tsx | 2 +- src/context/revoltjs/Notifications.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/context/Settings.tsx b/src/context/Settings.tsx index 58e05deb..7f834fea 100644 --- a/src/context/Settings.tsx +++ b/src/context/Settings.tsx @@ -25,7 +25,7 @@ interface Props { function Settings({ settings, children }: Props) { const play = useMemo(() => { - const enabled: SoundOptions = defaultsDeep(settings.notification ?? {}, DEFAULT_SOUNDS); + const enabled: SoundOptions = defaultsDeep(settings.notification?.sounds ?? {}, DEFAULT_SOUNDS); return (sound: Sounds) => { if (enabled[sound]) { playSound(sound); diff --git a/src/context/revoltjs/Notifications.tsx b/src/context/revoltjs/Notifications.tsx index 7f7fe11f..51f610b8 100644 --- a/src/context/revoltjs/Notifications.tsx +++ b/src/context/revoltjs/Notifications.tsx @@ -192,7 +192,7 @@ function Notifier(props: Props) { client.removeListener("message", message); client.users.removeListener("mutation", relationship); }; - }, [client, guild_id, channel_id, showNotification]); + }, [client, playSound, guild_id, channel_id, showNotification]); useEffect(() => { function visChange() {