From 0431308cb43e7b0c2b017b493f85b4652e8b45ba Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Mar 2026 20:36:32 +0000 Subject: [PATCH] Persist GPS coords in sessionStorage; fall back to raw coords on geocode failure iOS Safari can discard page JS state when backgrounding to open the camera. Saving gpsCoords to sessionStorage ensures the coords survive the round-trip and are still available when handleUpload runs after the photo is taken. Also change the server-side geocode fallback from empty string to raw lat/lon so the location column in the Excel sheet is never silently empty. https://claude.ai/code/session_015myTTMs6yDsAGarATe5ePZ --- src/main.rs | 2 +- templates/index.html | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 42c89c2..f97f1a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -133,7 +133,7 @@ async fn upload( let location = if let (Some(la), Some(lo)) = (lat, lon) { geocode::reverse_geocode(la, lo) .await - .unwrap_or_default() + .unwrap_or_else(|_| format!("{:.5}, {:.5}", la, lo)) } else { String::new() }; diff --git a/templates/index.html b/templates/index.html index f7aba83..3b9629f 100644 --- a/templates/index.html +++ b/templates/index.html @@ -156,7 +156,10 @@