From e980c1e0b3a5026b5efdfd8bd812b6bfef90bc45 Mon Sep 17 00:00:00 2001 From: Viren070 Date: Fri, 11 Jul 2025 13:41:18 +0100 Subject: [PATCH] fix: only standardise upon valdiation Release-As: 2.5.2 --- packages/frontend/src/components/menu/addons.tsx | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/packages/frontend/src/components/menu/addons.tsx b/packages/frontend/src/components/menu/addons.tsx index 2f629d7d..6db65953 100644 --- a/packages/frontend/src/components/menu/addons.tsx +++ b/packages/frontend/src/components/menu/addons.tsx @@ -606,13 +606,14 @@ function SortableAddonItem({ const handleManifestUpdate = async (e: React.FormEvent) => { e.preventDefault(); + const standardisedManifest = standardiseManifestUrl(newManifestUrl); if (!newManifestUrl) { toast.error('Please enter a new manifest URL'); return; } const regex = /^(https?|stremio):\/\/.+\/manifest\.json$/; - if (!regex.test(newManifestUrl)) { + if (!regex.test(standardisedManifest)) { toast.error('Please enter a valid manifest URL'); return; } @@ -620,7 +621,7 @@ function SortableAddonItem({ // attempt to fetch the manifest try { setLoading(true); - const response = await fetch(newManifestUrl); + const response = await fetch(standardisedManifest); if (!response.ok) { throw new Error(`${response.status} ${response.statusText}`); } @@ -639,7 +640,7 @@ function SortableAddonItem({ ...p, options: { ...p.options, - manifestUrl: newManifestUrl, + manifestUrl: standardisedManifest, }, } : p @@ -671,7 +672,7 @@ function SortableAddonItem({
{presetMetadata.ID === 'custom' ? ( - + ) : ( { - setNewManifestUrl(standardiseManifestUrl(v)); - }} + onValueChange={setNewManifestUrl} required autoFocus // Focus the input since it's the next logical action />