devstepbcn / react-native-android-wifi

A react-native module for viewing and connecting to Wifi networks on Android devices.
ISC License
212 stars 121 forks source link

Bugfix: improve branching logic and permissions comments #94

Open andrewhavens opened 5 years ago

andrewhavens commented 5 years ago

This PR fixes a bug in the placement of code that was intended to be within a try/catch block. It also improves and simplifies the logic and comments around requesting permissions for specific Android versions. Basically, I ran into a bug that was hard to figure out because the code was difficult to understand. I later learned that newer versions of Android (6.0.1+) no longer need to request permission to write to settings, but this wasn't clear enough in the code.