fix sound settings

This commit is contained in:
Layne 2022-03-16 11:56:08 -04:00
parent ff46a89e79
commit f85efea758

View File

@ -4,7 +4,7 @@ import { FC, useCallback, useEffect, useState } from 'react';
import { LocalizeText, SendMessageComposer } from '../../api'; import { LocalizeText, SendMessageComposer } from '../../api';
import { Column, Flex, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../common'; import { Column, Flex, NitroCardContentView, NitroCardHeaderView, NitroCardView, Text } from '../../common';
import { UserSettingsUIEvent } from '../../events'; import { UserSettingsUIEvent } from '../../events';
import { DispatchUiEvent, UseMessageEventHook, UseUiEvent } from '../../hooks'; import { DispatchMainEvent, DispatchUiEvent, UseMessageEventHook, UseUiEvent } from '../../hooks';
export const UserSettingsView: FC<{}> = props => export const UserSettingsView: FC<{}> = props =>
{ {
@ -46,6 +46,7 @@ export const UserSettingsView: FC<{}> = props =>
settingsEvent.chatType = parser.chatType; settingsEvent.chatType = parser.chatType;
setUserSettings(settingsEvent); setUserSettings(settingsEvent);
DispatchMainEvent(settingsEvent);
}, []); }, []);
UseMessageEventHook(UserSettingsEvent, onUserSettingsEvent); UseMessageEventHook(UserSettingsEvent, onUserSettingsEvent);
@ -92,6 +93,7 @@ export const UserSettingsView: FC<{}> = props =>
} }
if(doUpdate) setUserSettings(clone); if(doUpdate) setUserSettings(clone);
DispatchMainEvent(clone)
}, [userSettings]); }, [userSettings]);
const saveRangeSlider = useCallback((type: string) => const saveRangeSlider = useCallback((type: string) =>