From 1e2ef1d90c24526dab022ea6a2482e02a43c528e Mon Sep 17 00:00:00 2001 From: glax Date: Mon, 4 Aug 2025 12:21:14 +0200 Subject: [PATCH] Fix Api-Uri ending in "/" --- tranga-website/src/Components/Settings/Settings.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tranga-website/src/Components/Settings/Settings.tsx b/tranga-website/src/Components/Settings/Settings.tsx index ab4c288..e3172fd 100644 --- a/tranga-website/src/Components/Settings/Settings.tsx +++ b/tranga-website/src/Components/Settings/Settings.tsx @@ -38,8 +38,12 @@ export default function Settings({setApiUri} : {setApiUri: Dispatch) => { clearTimeout(timerRef.current); setApiUriColor("warning"); + + const val = e.target.value; + const value = val.endsWith("/") ? val.substring(0, val.length - 1) : val; + timerRef.current = setTimeout(() => { - setApiUri(e.target.value); + setApiUri(value); setApiUriColor("success"); }, 1000); }