|
@@ -83,10 +83,10 @@ import MapButton from 'src/components/MapButton';
|
|
|
import { useAvatarStore } from 'src/stores/avatarVersionStore';
|
|
|
import _ from 'lodash';
|
|
|
import ScaleBar from 'src/components/ScaleBar';
|
|
|
-import {
|
|
|
- startBackgroundLocationUpdates,
|
|
|
- stopBackgroundLocationUpdates
|
|
|
-} from 'src/utils/backgroundLocation';
|
|
|
+// import {
|
|
|
+// startBackgroundLocationUpdates,
|
|
|
+// stopBackgroundLocationUpdates
|
|
|
+// } from 'src/utils/backgroundLocation';
|
|
|
|
|
|
const defaultUserAvatar = require('assets/icon-user-share-location-solid.png');
|
|
|
const logo = require('assets/logo-ua.png');
|
|
@@ -625,23 +625,23 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
) {
|
|
|
setShowNomads(false);
|
|
|
storage.set('showNomads', false);
|
|
|
- await stopBackgroundLocationUpdates();
|
|
|
+ // await stopBackgroundLocationUpdates();
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- const bgStatus = await Location.getBackgroundPermissionsAsync();
|
|
|
- if (bgStatus.status !== 'granted') {
|
|
|
- const { status } = await Location.requestBackgroundPermissionsAsync();
|
|
|
- if (status === Location.PermissionStatus.GRANTED) {
|
|
|
- await startBackgroundLocationUpdates();
|
|
|
- console.log('[Permissions] Background granted');
|
|
|
- } else {
|
|
|
- console.log('[Permissions] Background denied');
|
|
|
- }
|
|
|
- } else {
|
|
|
- await startBackgroundLocationUpdates();
|
|
|
- console.log('[Permissions] Background already granted');
|
|
|
- }
|
|
|
+ // const bgStatus = await Location.getBackgroundPermissionsAsync();
|
|
|
+ // if (bgStatus.status !== 'granted') {
|
|
|
+ // const { status } = await Location.requestBackgroundPermissionsAsync();
|
|
|
+ // if (status === Location.PermissionStatus.GRANTED) {
|
|
|
+ // await startBackgroundLocationUpdates();
|
|
|
+ // console.log('[Permissions] Background granted');
|
|
|
+ // } else {
|
|
|
+ // console.log('[Permissions] Background denied');
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // await startBackgroundLocationUpdates();
|
|
|
+ // console.log('[Permissions] Background already granted');
|
|
|
+ // }
|
|
|
|
|
|
try {
|
|
|
let currentLocation = await Location.getCurrentPositionAsync({
|
|
@@ -913,19 +913,19 @@ const MapScreen: any = ({ navigation, route }: { navigation: any; route: any })
|
|
|
|
|
|
if (status === 'granted' && isServicesEnabled) {
|
|
|
await getLocation();
|
|
|
- const bgStatus = await Location.getBackgroundPermissionsAsync();
|
|
|
- if (bgStatus.status !== 'granted') {
|
|
|
- const { status } = await Location.requestBackgroundPermissionsAsync();
|
|
|
- if (status === Location.PermissionStatus.GRANTED) {
|
|
|
- await startBackgroundLocationUpdates();
|
|
|
- console.log('[Permissions] Background granted');
|
|
|
- } else {
|
|
|
- console.log('[Permissions] Background denied');
|
|
|
- }
|
|
|
- } else {
|
|
|
- await startBackgroundLocationUpdates();
|
|
|
- console.log('[Permissions] Background already granted');
|
|
|
- }
|
|
|
+ // const bgStatus = await Location.getBackgroundPermissionsAsync();
|
|
|
+ // if (bgStatus.status !== 'granted') {
|
|
|
+ // const { status } = await Location.requestBackgroundPermissionsAsync();
|
|
|
+ // if (status === Location.PermissionStatus.GRANTED) {
|
|
|
+ // await startBackgroundLocationUpdates();
|
|
|
+ // console.log('[Permissions] Background granted');
|
|
|
+ // } else {
|
|
|
+ // console.log('[Permissions] Background denied');
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // await startBackgroundLocationUpdates();
|
|
|
+ // console.log('[Permissions] Background already granted');
|
|
|
+ // }
|
|
|
} else if (!canAskAgain || !isServicesEnabled) {
|
|
|
setOpenSettingsVisible(true);
|
|
|
} else {
|