correctly handle location permission state changes
This commit is contained in:
parent
eff4214121
commit
4a21ad983e
1 changed files with 10 additions and 5 deletions
|
@ -1304,8 +1304,8 @@ c3nav = {
|
|||
},
|
||||
|
||||
_hasLocationPermission: undefined,
|
||||
hasLocationPermission: function() {
|
||||
if (c3nav._hasLocationPermission === undefined) {
|
||||
hasLocationPermission: function(nocache) {
|
||||
if (c3nav._hasLocationPermission === undefined || (nocache !== undefined && nocache === true)) {
|
||||
c3nav._hasLocationPermission = window.mobileclient && (typeof window.mobileclient.hasLocationPermission !== 'function' || window.mobileclient.hasLocationPermission())
|
||||
}
|
||||
return c3nav._hasLocationPermission;
|
||||
|
@ -1327,12 +1327,17 @@ c3nav = {
|
|||
_last_wifi_scant: 0,
|
||||
|
||||
_wifi_scan_results: function(data) {
|
||||
c3nav._hasLocationPermission = true;
|
||||
data = JSON.parse(data);
|
||||
|
||||
if (data.length) {
|
||||
c3nav._hasLocationPermission = true;
|
||||
} else {
|
||||
c3nav.hasLocationPermission(true);
|
||||
}
|
||||
|
||||
var now = Date.now();
|
||||
if (now-4000 < c3nav._last_wifi_scan) return;
|
||||
|
||||
data = JSON.parse(data);
|
||||
|
||||
if (c3nav.ssids) {
|
||||
var newdata = [];
|
||||
for (var i=0; i<data.length; i++) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue