mobile: fix color scheme

This commit is contained in:
ammarahm-ed
2023-08-09 09:33:06 +05:00
committed by Ammar Ahmed
parent f157229e00
commit 11f39316b5

View File

@@ -44,13 +44,14 @@ if (appSettings) {
} }
const systemColorScheme = Appearance.getColorScheme(); const systemColorScheme = Appearance.getColorScheme();
const appColorScheme = appSettings.colorScheme; const appColorScheme = appSettings?.colorScheme;
const useSystemTheme = appSettings.useSystemTheme; const useSystemTheme = appSettings?.useSystemTheme;
const currentColorScheme = useSystemTheme ? systemColorScheme : appColorScheme; const currentColorScheme = useSystemTheme ? systemColorScheme : appColorScheme;
const theme = currentColorScheme const theme =
? appSettings?.darkTheme currentColorScheme === "dark"
: appSettings?.lightTheme; ? appSettings?.darkTheme
: appSettings?.lightTheme;
const currentTheme = const currentTheme =
theme || (currentColorScheme === "dark" ? ThemeDark : ThemeLight); theme || (currentColorScheme === "dark" ? ThemeDark : ThemeLight);