react-native-location-enabler
react-native-location-enabler copied to clipboard
ActivityEventListener listens to all requestCode
Hello,
I've got an issue when listening to LocationEnabler. locationEnabled is emitted as false each time I return from library selection activity for example.
This line prevents the listener to return early resulting in an incorrect interpretation of arguments.
For example if I've opened the library with a random request code 12345. Here the Intent is null. So the code continues.
if (intent !== null && requestCode != REQUEST_TURN_DEVICE_LOCATION_ON) return
I'd just remove the "intent !== null" part. Because I don't see any reason to continue if the request code is not 29. But maybe I'm missing an important detail here for why this is done with "intent !== null" ?