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() {