thebylito / react-native-navigation-bar-color

React Native component to change bottom bar/navigation bar color on Android
MIT License
269 stars 49 forks source link

Crash production on Galaxy S10 5G (SM-G977N) #48

Open tudiantuan opened 3 years ago

tudiantuan commented 3 years ago

I recive report ErrorNavigationBarColorModule.java:8 Tried to change the navigation bar while not attached to an Activity. Model Galaxy S10 5G (SM-G977N)

felipegmg commented 2 years ago

+1

MorganTrudeau commented 1 year ago

This shows as unhandled for me in bugsnag but it's not a crash. It's because the promise is not returned from js.

patch...

diff --git a/node_modules/react-native-navigation-bar-color/src/index.js b/node_modules/react-native-navigation-bar-color/src/index.js
index eeab32f..edc4ce0 100644
--- a/node_modules/react-native-navigation-bar-color/src/index.js
+++ b/node_modules/react-native-navigation-bar-color/src/index.js
@@ -9,7 +9,7 @@ const changeNavigationBarColor = (
 ) => {
   if (Platform.OS === 'android') {
     const LightNav = light ? true : false;
-    NavigationBarColor.changeNavigationBarColor(color, LightNav, animated);
+    return NavigationBarColor.changeNavigationBarColor(color, LightNav, animated);
   }
 };
 const hideNavigationBar = () => {
@@ -21,7 +21,7 @@ const hideNavigationBar = () => {
 };
 const showNavigationBar = () => {
   if (Platform.OS === 'android') {
-    NavigationBarColor.showNavigationBar();
+    return NavigationBarColor.showNavigationBar();
   } else {
     return false;
   }
chmiiller commented 1 year ago

shall we open a PR with this change @MorganTrudeau ? I can do it

chmiiller commented 1 year ago

oh, I see that there's a PR already (#37 ) and an issue #36