From 2fa2c94ed2d2f4d76c2ca1f62e38533970ea359a Mon Sep 17 00:00:00 2001 From: Anthony Ettinger Date: Wed, 11 Nov 2026 06:33:41 +0000 Subject: [PATCH] fix(submit): an OPML file alone can be submitted (0.6.2) The URL textarea was always required, so choosing only an OPML file was blocked by the browser's 'Please fill out this field' before any request was sent. The box is now required only when no file is chosen. Co-Authored-By: Claude Opus 5.5 --- package.json | 2 +- src/components/SubmitForm.tsx | 14 +++++++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 8e35e7b..bb55ef1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "p0dcasters", - "version": "0.6.1", + "version": "0.6.2", "private": true, "type": "module", "scripts": { diff --git a/src/components/SubmitForm.tsx b/src/components/SubmitForm.tsx index bf4d65e..3b233a7 100644 --- a/src/components/SubmitForm.tsx +++ b/src/components/SubmitForm.tsx @@ -27,6 +27,8 @@ type Reply = { export default function SubmitForm({ initial, error, errorUrl }: { initial: string; error: string; errorUrl: string }) { const [input, setInput] = useState(initial || errorUrl); const [busy, setBusy] = useState(false); + /** An OPML file stands in for the URL box, so the box is only required without one. */ + const [hasFile, setHasFile] = useState(false); const [reply, setReply] = useState(null); const [failure, setFailure] = useState(error ? describe(error) : null); @@ -77,7 +79,7 @@ export default function SubmitForm({ initial, error, errorUrl }: { initial: stri id="input" name="input" rows={3} - required={!reply} + required={!reply && !hasFile} placeholder={"https://example.com\nhttps://example.org/podcast.rss"} value={input} onChange={(e) => setInput(e.target.value)} @@ -88,9 +90,15 @@ export default function SubmitForm({ initial, error, errorUrl }: { initial: stri - + setHasFile(Boolean(e.target.files?.length))} + />