From 6ad7f3c40055c2aa650d253e1294b686fb2d635d Mon Sep 17 00:00:00 2001
From: Santo Cariotti <santo@dcariotti.me>
Date: Mon, 10 Feb 2025 14:59:27 +0100
Subject: Update location every 2 seconds

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

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

diff --git a/app/(tabs)/index.tsx b/app/(tabs)/index.tsx
index 734fa5e..f83b6c0 100644
--- a/app/(tabs)/index.tsx
+++ b/app/(tabs)/index.tsx
@@ -467,6 +467,11 @@ export default function HomeScreen() {
             updateLocation(location.coords, location.coords.speed);
           });
 
+          setInterval(async () => {
+            const location = await Location.getCurrentPositionAsync({});
+            updateLocation(location.coords, location.coords.speed);
+          }, 2000);
+
           Location.watchPositionAsync(
             {
               accuracy: Location.Accuracy.Balanced,
-- 
cgit v1.2.3-18-g5258

