From b313a726c1231a75c109d83131817de35d82bd39 Mon Sep 17 00:00:00 2001 From: Dennis Falling Date: Thu, 4 Jun 2026 20:04:16 +0100 Subject: [PATCH] Allow saving elements without a URL The URL field is optional, but canSave required a valid URL, so an element with no URL could never be saved. Permit an empty URL while still rejecting a non-empty invalid one. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/map/ElementEditScreen.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/map/ElementEditScreen.tsx b/src/map/ElementEditScreen.tsx index f374c8c..7a0f89b 100644 --- a/src/map/ElementEditScreen.tsx +++ b/src/map/ElementEditScreen.tsx @@ -82,7 +82,11 @@ function EditForm({element, onDone}: {element: Element; onDone: () => void}) { const uriError = trimmedUri.length > 0 && !uriValid ? 'Enter a valid URL.' : null; - const canSave = name.trim().length > 0 && uriValid && !saving && !uploading; + const canSave = + name.trim().length > 0 && + (trimmedUri.length === 0 || uriValid) && + !saving && + !uploading; async function onAddPhoto() { setErrorMessage(null);