feat: похуй 2.0
This commit is contained in:
@@ -68,7 +68,6 @@ export function Converter() {
|
||||
<button
|
||||
type="button"
|
||||
className={styles.swapBtn}
|
||||
onClick={c.toggleMode}
|
||||
aria-label="Поменять направление"
|
||||
>
|
||||
<svg width={16} height={16} viewBox="0 0 16 16" fill="none">
|
||||
|
||||
@@ -1,10 +1,8 @@
|
||||
import { useState } from 'react'
|
||||
import { useMutation, useQueryClient } from '@tanstack/react-query'
|
||||
import { useNavigate, useLocation } from 'react-router-dom'
|
||||
import { loginStart, loginComplete, AUTH_QUERY_KEY } from '@features/auth'
|
||||
import { tokenStore } from '@shared/api/tokenStore'
|
||||
import { clearCsrfCache } from '@shared/api/csrf'
|
||||
import { ROUTES } from '@shared/config/routes'
|
||||
import type { ApiErrorResponse } from '@shared/api/types'
|
||||
|
||||
function extractErrorMessage(error: unknown): string {
|
||||
@@ -17,10 +15,7 @@ export function useLoginForm() {
|
||||
const [password, setPassword] = useState('')
|
||||
const [verificationCode, setVerificationCode] = useState('')
|
||||
const [codeSent, setCodeSent] = useState(false)
|
||||
const navigate = useNavigate()
|
||||
const location = useLocation()
|
||||
const queryClient = useQueryClient()
|
||||
const from = (location.state as { from?: { pathname: string } })?.from?.pathname ?? ROUTES.WALLET
|
||||
|
||||
const startMutation = useMutation({
|
||||
mutationFn: loginStart,
|
||||
@@ -33,7 +28,6 @@ export function useLoginForm() {
|
||||
clearCsrfCache()
|
||||
tokenStore.set(access_token)
|
||||
queryClient.setQueryData(AUTH_QUERY_KEY, access_token)
|
||||
navigate(from, { replace: true })
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user