summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2025-01-21 15:25:43 +0100
committerSanto Cariotti <santo@dcariotti.me>2025-01-21 15:25:43 +0100
commit1f7995cddb10130805161711862d8a6d1b4b4ebc (patch)
tree04a38e3c76e9b992ff4ef773af1fd7218a387218
parentad852039098a500fcf241ec5f4bc7ffd63825a19 (diff)
Get current position when you open the appmain
-rw-r--r--app/(tabs)/index.tsx4
1 files changed, 4 insertions, 0 deletions
diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx
index 6f196ea..734fa5e 100644
--- a/app/(tabs)/index.tsx
+++ b/app/(tabs)/index.tsx
@@ -463,6 +463,10 @@ export default function HomeScreen() {
try {
const { status } = await Location.requestForegroundPermissionsAsync();
if (status === "granted") {
+ Location.getCurrentPositionAsync({}).then(location => {
+ updateLocation(location.coords, location.coords.speed);
+ });
+
Location.watchPositionAsync(
{
accuracy: Location.Accuracy.Balanced,