mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 19:09:29 +00:00
fix typo, channel tabs not tags
This commit is contained in:
@@ -14,7 +14,6 @@ const Login = () => {
|
|||||||
const [password, setPassword] = useState('');
|
const [password, setPassword] = useState('');
|
||||||
const [saveLogin, setSaveLogin] = useState(false);
|
const [saveLogin, setSaveLogin] = useState(false);
|
||||||
const [waitingForBackend, setWaitingForBackend] = useState(false);
|
const [waitingForBackend, setWaitingForBackend] = useState(false);
|
||||||
const [loggingIn, setLoggingIn] = useState(false);
|
|
||||||
const [waitedCount, setWaitedCount] = useState(0);
|
const [waitedCount, setWaitedCount] = useState(0);
|
||||||
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
const [errorMessage, setErrorMessage] = useState<string | null>(null);
|
||||||
|
|
||||||
@@ -26,15 +25,17 @@ const Login = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
setErrorMessage(null);
|
setErrorMessage(null);
|
||||||
setLoggingIn(true);
|
|
||||||
const loginResponse = await signIn(username, password, saveLogin);
|
const loginResponse = await signIn(username, password, saveLogin);
|
||||||
|
|
||||||
const signedIn = loginResponse.status === 204;
|
const signedIn = loginResponse.status === 204;
|
||||||
|
|
||||||
if (signedIn) {
|
if (signedIn) {
|
||||||
navigate(Routes.Home);
|
navigate(Routes.Home);
|
||||||
} else {
|
} else {
|
||||||
const data = await loginResponse.json();
|
const data = await loginResponse.json();
|
||||||
setErrorMessage(data?.error || 'Unknown Error');
|
setErrorMessage(data?.error || 'Unknown Error');
|
||||||
setLoggingIn(false);
|
navigate(Routes.Login);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -139,7 +140,7 @@ const Login = () => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
{!waitingForBackend && <Button label="Login" type="submit" disabled={loggingIn} />}
|
{!waitingForBackend && <Button label="Login" type="submit" />}
|
||||||
</form>
|
</form>
|
||||||
|
|
||||||
{waitedCount > 10 && (
|
{waitedCount > 10 && (
|
||||||
|
|||||||
Reference in New Issue
Block a user