context/form-state: rename steps

This commit is contained in:
vchikalkin 2024-07-18 20:22:44 +03:00
parent e41d6e3c46
commit fd43833aca
3 changed files with 6 additions and 6 deletions

View File

@ -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', () => {});

View File

@ -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>

View File

@ -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;
};