Fix: Notification settings not affecting playSound
parent
b833f0cc31
commit
fa3f756ae7
|
|
@ -25,7 +25,7 @@ interface Props {
|
||||||
|
|
||||||
function Settings({ settings, children }: Props) {
|
function Settings({ settings, children }: Props) {
|
||||||
const play = useMemo(() => {
|
const play = useMemo(() => {
|
||||||
const enabled: SoundOptions = defaultsDeep(settings.notification ?? {}, DEFAULT_SOUNDS);
|
const enabled: SoundOptions = defaultsDeep(settings.notification?.sounds ?? {}, DEFAULT_SOUNDS);
|
||||||
return (sound: Sounds) => {
|
return (sound: Sounds) => {
|
||||||
if (enabled[sound]) {
|
if (enabled[sound]) {
|
||||||
playSound(sound);
|
playSound(sound);
|
||||||
|
|
|
||||||
|
|
@ -192,7 +192,7 @@ function Notifier(props: Props) {
|
||||||
client.removeListener("message", message);
|
client.removeListener("message", message);
|
||||||
client.users.removeListener("mutation", relationship);
|
client.users.removeListener("mutation", relationship);
|
||||||
};
|
};
|
||||||
}, [client, guild_id, channel_id, showNotification]);
|
}, [client, playSound, guild_id, channel_id, showNotification]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
function visChange() {
|
function visChange() {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue