Fix Api-Uri ending in "/"

This commit is contained in:
2025-08-04 12:21:14 +02:00
parent b98bd3a11d
commit 1e2ef1d90c

View File

@@ -38,8 +38,12 @@ export default function Settings({setApiUri} : {setApiUri: Dispatch<React.SetSta
const apiUriChanged = (e : React.ChangeEvent<HTMLInputElement>) => { const apiUriChanged = (e : React.ChangeEvent<HTMLInputElement>) => {
clearTimeout(timerRef.current); clearTimeout(timerRef.current);
setApiUriColor("warning"); setApiUriColor("warning");
const val = e.target.value;
const value = val.endsWith("/") ? val.substring(0, val.length - 1) : val;
timerRef.current = setTimeout(() => { timerRef.current = setTimeout(() => {
setApiUri(e.target.value); setApiUri(value);
setApiUriColor("success"); setApiUriColor("success");
}, 1000); }, 1000);
} }