[FIX] Wait attach activity before changeNavigationBarColor (#2111)
* [FIX] Wait attach activity before changeNavigationBarColor * Remove timeout and add try/catch Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
70462f7c6f
commit
5c99d8aa8d
|
@ -35,11 +35,15 @@ export const newThemeState = (prevState, newTheme) => {
|
||||||
return { themePreferences, theme: getTheme(themePreferences) };
|
return { themePreferences, theme: getTheme(themePreferences) };
|
||||||
};
|
};
|
||||||
|
|
||||||
export const setNativeTheme = (themePreferences) => {
|
export const setNativeTheme = async(themePreferences) => {
|
||||||
const theme = getTheme(themePreferences);
|
const theme = getTheme(themePreferences);
|
||||||
if (isAndroid) {
|
if (isAndroid) {
|
||||||
const iconsLight = theme === 'light';
|
const iconsLight = theme === 'light';
|
||||||
changeNavigationBarColor(themes[theme].navbarBackground, iconsLight);
|
try {
|
||||||
|
await changeNavigationBarColor(themes[theme].navbarBackground, iconsLight);
|
||||||
|
} catch (error) {
|
||||||
|
// Do nothing
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setRootViewColor(themes[theme].backgroundColor);
|
setRootViewColor(themes[theme].backgroundColor);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue