fix: resolve type errors

This commit is contained in:
Afra ‌ 2026-08-01 16:13:11 +03:30
parent b8bc0fa8b7
commit eb63f580e0
2 changed files with 4 additions and 9 deletions

View file

@ -21,4 +21,4 @@ export interface SendOtpResponse {
phoneNumber: string;
}
export interface VerifyOtpResponse extends LoginSuccessPayload {}
export type VerifyOtpResponse = LoginSuccessPayload;

View file

@ -1,4 +1,4 @@
import { Button, Card, Form, Input, Typography, message } from 'antd';
import { Button, Card, Form, Input, Typography, message, type InputRef } from 'antd';
import { useEffect, useRef, useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { useAppDispatch } from '../../utils/hooks';
@ -16,16 +16,11 @@ interface VerifyOtpFormValues {
const VerifyOtp = () => {
const navigate = useNavigate();
const dispatch = useAppDispatch();
const [phoneNumber, setPhoneNumber] = useState('');
const [phoneNumber] = useState(() => localStorage.getItem('pending_phone_number') ?? '');
const [form] = Form.useForm<VerifyOtpFormValues>();
const otpInputRef = useRef<any>(null);
const otpInputRef = useRef<InputRef>(null);
useEffect(() => {
const storedPhoneNumber = localStorage.getItem('pending_phone_number');
if (storedPhoneNumber) {
setPhoneNumber(storedPhoneNumber);
}
const timeoutId = window.setTimeout(() => {
otpInputRef.current?.focus();
}, 100);