mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-09-10 20:08:19 +02:00
Fix Api-Uri ending in "/"
This commit is contained in:
@@ -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);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user