Subscribe to theme change in settings

This commit is contained in:
Fedor Indutny 2021-09-29 11:37:30 -07:00 committed by GitHub
parent 64fc234490
commit bdf1287403
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 50 additions and 13 deletions

View file

@ -69,7 +69,6 @@ export type PropsType = {
selectedCamera?: string;
selectedMicrophone?: AudioDevice;
selectedSpeaker?: AudioDevice;
theme: ThemeType;
themeSetting: ThemeSettingType;
universalExpireTimer: number;
whoCanFindMe: PhoneNumberDiscoverability;
@ -257,7 +256,6 @@ export const Preferences = ({
selectedMicrophone,
selectedSpeaker,
setGlobalDefaultConversationColor,
theme,
themeSetting,
universalExpireTimer = 0,
whoCanFindMe,
@ -273,11 +271,6 @@ export const Preferences = ({
setShowDisappearingTimerDialog,
] = useState(false);
useEffect(() => {
document.body.classList.toggle('light-theme', theme === ThemeType.light);
document.body.classList.toggle('dark-theme', theme === ThemeType.dark);
}, [theme]);
useEffect(() => {
doneRendering();
}, [doneRendering]);