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