fix: bottom nav disappears after visiting payment page in Telegram

- Reset isKeyboardOpen on route change so bottom nav always restores
- Disable autoFocus on payment input in Telegram Mini App
- Skip auto-focus on Profile email inputs in Telegram
This commit is contained in:
c0mrade
2026-03-27 13:40:13 +03:00
parent 5246ad2a09
commit 3b659b7450
3 changed files with 14 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
import { useState, useRef, useEffect } from 'react';
import { Link, useNavigate } from 'react-router';
import { useTranslation } from 'react-i18next';
import { usePlatform } from '@/platform';
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
import { motion, AnimatePresence } from 'framer-motion';
import { useAuthStore } from '../store/auth';
@@ -250,14 +251,16 @@ export default function Profile() {
return () => clearInterval(timer);
}, [verificationResendCooldown]);
// Auto-focus inputs on step change
// Auto-focus inputs on step change (skip on Telegram — keyboard hides bottom nav)
const { platform: profilePlatform } = usePlatform();
useEffect(() => {
if (profilePlatform === 'telegram') return;
const timer = setTimeout(() => {
if (changeEmailStep === 'email') newEmailInputRef.current?.focus();
else if (changeEmailStep === 'code') codeInputRef.current?.focus();
}, 100);
return () => clearTimeout(timer);
}, [changeEmailStep]);
}, [changeEmailStep, profilePlatform]);
// Auto-close success after 3s
useEffect(() => {