context/form-state: rename steps
This commit is contained in:
parent
e41d6e3c46
commit
fd43833aca
@ -20,7 +20,7 @@ export function useLogin() {
|
||||
.then((res) => {
|
||||
dispatch({
|
||||
payload: {
|
||||
step: 'telegram',
|
||||
step: 'login-success',
|
||||
user: res.data,
|
||||
},
|
||||
type: 'set-step',
|
||||
@ -46,7 +46,7 @@ export function useTelegramLogin() {
|
||||
.then(() => {
|
||||
dispatch({
|
||||
payload: {
|
||||
step: 'telegram-login',
|
||||
step: 'telegram-notification',
|
||||
},
|
||||
type: 'set-step',
|
||||
});
|
||||
@ -71,7 +71,7 @@ export function useTelegramConfirm() {
|
||||
const { socket } = useSocket();
|
||||
|
||||
useEffect(() => {
|
||||
if (step === 'telegram-login') {
|
||||
if (step === 'telegram-notification') {
|
||||
socket.open();
|
||||
socket.on('connect', () => {});
|
||||
|
||||
|
||||
@ -19,7 +19,7 @@ export function TelegramForm() {
|
||||
return <ButtonLoading>Подождите...</ButtonLoading>;
|
||||
}
|
||||
|
||||
if (step === 'telegram') {
|
||||
if (step === 'login-success') {
|
||||
return (
|
||||
<BaseForm onSubmit={() => handleTelegramLogin()}>
|
||||
<ButtonTelegram>Войти через Telegram</ButtonTelegram>
|
||||
@ -27,7 +27,7 @@ export function TelegramForm() {
|
||||
);
|
||||
}
|
||||
|
||||
if (step === 'telegram-login') {
|
||||
if (step === 'telegram-notification') {
|
||||
return (
|
||||
<BaseForm onSubmit={() => {}}>
|
||||
<ButtonTelegramLogin>Ожидаем подтверждения...</ButtonTelegramLogin>
|
||||
|
||||
@ -5,7 +5,7 @@ import { createContext, useMemo, useReducer } from 'react';
|
||||
|
||||
type State = {
|
||||
error: string | undefined;
|
||||
step: 'login' | 'telegram' | 'telegram-login';
|
||||
step: 'login' | 'login-success' | 'telegram-notification';
|
||||
tfa: boolean;
|
||||
user: LdapUser | undefined;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user