telegram
Some checks failed
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
Web App CI / test (push) Has been cancelled
Web App CI / build (push) Has been cancelled
Some checks failed
Deploy Mnemo Cards / Deploy Backend (push) Waiting to run
Deploy Mnemo Cards / Deploy Web App (push) Blocked by required conditions
Deploy Mnemo Cards / Final Verification (push) Blocked by required conditions
Web App CI / test (push) Has been cancelled
Web App CI / build (push) Has been cancelled
This commit is contained in:
parent
391c54fb15
commit
f056961d8e
1 changed files with 5 additions and 5 deletions
|
|
@ -44,8 +44,8 @@ class _SignInWithTelegramState extends State<SignInWithTelegram> {
|
|||
super.dispose();
|
||||
}
|
||||
|
||||
Future<void> _loginWithTelegram() async {
|
||||
final code = _telegramCodeController.text.trim();
|
||||
Future<void> _loginWithTelegram({String? codeParam}) async {
|
||||
final code = codeParam ?? _telegramCodeController.text.trim();
|
||||
|
||||
if (code.isEmpty) {
|
||||
widget.onError('Введите код авторизации');
|
||||
|
|
@ -191,15 +191,15 @@ class _SignInWithTelegramState extends State<SignInWithTelegram> {
|
|||
widget.onError('Срок действия кода истёк. Сгенерируйте новый.');
|
||||
} else if (status.isConsumed) {
|
||||
_stopCodePolling();
|
||||
} else if (status.isReadyForLogin && !_autoLoginAttempted && mounted) {
|
||||
} else if (status.isReadyForLogin) {
|
||||
log('Auto-login triggered for code: ${status.code}', name: 'SignInWithTelegram');
|
||||
_autoLoginAttempted = true;
|
||||
|
||||
// Small delay to ensure UI updates are processed before navigation
|
||||
await Future.delayed(const Duration(milliseconds: 100));
|
||||
// await Future<void>.delayed(const Duration(milliseconds: 100));
|
||||
|
||||
if (mounted) {
|
||||
await _loginWithTelegram();
|
||||
await _loginWithTelegram(codeParam: status.code);
|
||||
}
|
||||
}
|
||||
} catch (e, s) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue