From 1f7995cddb10130805161711862d8a6d1b4b4ebc Mon Sep 17 00:00:00 2001
From: Santo Cariotti <santo@dcariotti.me>
Date: Tue, 21 Jan 2025 15:25:43 +0100
Subject: Get current position when you open the app

---
 app/(tabs)/index.tsx | 4 ++++
 1 file changed, 4 insertions(+)

(limited to 'app/(tabs)/index.tsx')

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,
-- 
cgit v1.2.3-18-g5258

