Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/libs/getCurrentPosition/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import {getCurrentPositionAsync, PermissionStatus, requestForegroundPermissionsAsync} from 'expo-location';
import type {PermissionResponse} from 'expo-location';
import {Platform} from 'react-native';
import {GeolocationErrorCode} from './getCurrentPosition.types';
import type {GetCurrentPosition} from './getCurrentPosition.types';

Expand All @@ -18,7 +19,7 @@ const getCurrentPosition: GetCurrentPosition = async (success, error, options) =
let message = 'Geolocation call failed';
let code = GeolocationErrorCode.POSITION_UNAVAILABLE;

if (caughtError instanceof GeolocationPositionError) {
if (Platform.OS === 'web' && caughtError instanceof GeolocationPositionError) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the file is small, can we separate this into index.ts, index.native.ts?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes we just chatted about it but in sake of fixing this asap we allow it for this PR

code = caughtError.code;
message = caughtError.message;
} else if (caughtError instanceof Error) {
Expand Down
Loading