feat: Implement expandable tag sections with "Show More/Less" functionality on the agent home screen.
This commit is contained in:
@@ -18,6 +18,7 @@ class _Verify2faScreenState extends ConsumerState<Verify2faScreen> {
|
||||
final List<FocusNode> _focusNodes = List.generate(6, (_) => FocusNode());
|
||||
final TextEditingController _backupController = TextEditingController();
|
||||
bool _useBackupCode = false;
|
||||
bool _isSubmitting = false;
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
@@ -69,13 +70,17 @@ class _Verify2faScreenState extends ConsumerState<Verify2faScreen> {
|
||||
}
|
||||
|
||||
void _submit() {
|
||||
if (_isSubmitting) return;
|
||||
|
||||
if (_useBackupCode) {
|
||||
final code = _backupController.text.trim();
|
||||
if (code.isEmpty) return;
|
||||
_isSubmitting = true;
|
||||
ref.read(authProvider.notifier).verifyBackupCode(code);
|
||||
} else {
|
||||
final code = _otpCode;
|
||||
if (code.length != 6) return;
|
||||
_isSubmitting = true;
|
||||
ref.read(authProvider.notifier).verifyTwoFactor(code);
|
||||
}
|
||||
}
|
||||
@@ -90,11 +95,14 @@ class _Verify2faScreenState extends ConsumerState<Verify2faScreen> {
|
||||
final authState = ref.watch(authProvider);
|
||||
final isLoading = authState.status == AuthStatus.loading;
|
||||
|
||||
// Navigate to home when authentication succeeds
|
||||
// Navigate to home when authentication succeeds, reset submit lock on error
|
||||
ref.listen<AuthState>(authProvider, (previous, next) {
|
||||
if (next.status == AuthStatus.authenticated) {
|
||||
context.go('/home');
|
||||
}
|
||||
if (next.status != AuthStatus.loading) {
|
||||
_isSubmitting = false;
|
||||
}
|
||||
});
|
||||
|
||||
return Scaffold(
|
||||
|
||||
Reference in New Issue
Block a user