From 2c6b1feca651b32c234e16941e0cdf7364222b95 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Wed, 13 Nov 2024 22:39:51 +0800 Subject: [PATCH] :bug: Fix login didn't request factor code correctly --- lib/screens/auth/login.dart | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/screens/auth/login.dart b/lib/screens/auth/login.dart index 59f2d13..d4d3082 100644 --- a/lib/screens/auth/login.dart +++ b/lib/screens/auth/login.dart @@ -271,13 +271,14 @@ class _LoginPickerScreenState extends State<_LoginPickerScreen> { try { // Request one-time-password code - sn.client.post('/cgi/id/auth/factors/$_factorPicked'); + await sn.client.post('/cgi/id/auth/factors/$_factorPicked'); widget.onPickFactor( widget.factors!.where((x) => x.id == _factorPicked).first, ); widget.onNext(); } catch (err) { - context.showErrorDialog(err); + // ignore: use_build_context_synchronously + if (context.mounted) context.showErrorDialog(err); return; } finally { setState(() => _isBusy = false);