mirror of
https://github.com/C9Glax/tranga-website.git
synced 2025-09-10 11:58:20 +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>) => {
|
||||
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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user