From a6fbf70ad5b6bbe72e30fb6c372d05afa4d2cc89 Mon Sep 17 00:00:00 2001 From: qzl Date: Thu, 26 Feb 2026 11:28:33 +0800 Subject: [PATCH] fix(auth): reset state properly in sendCodeSilently --- .../auth/presentation/cubits/register_cubit.dart | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/apps/lib/features/auth/presentation/cubits/register_cubit.dart b/apps/lib/features/auth/presentation/cubits/register_cubit.dart index c9c03dc..3b71f3b 100644 --- a/apps/lib/features/auth/presentation/cubits/register_cubit.dart +++ b/apps/lib/features/auth/presentation/cubits/register_cubit.dart @@ -188,7 +188,13 @@ class RegisterCubit extends Cubit { Future sendCodeSilently() async { if (!state.isStep1Valid || state.isSending) return; - emit(state.copyWith(isSending: true)); + emit( + state.copyWith( + isSending: true, + status: FormzSubmissionStatus.inProgress, + errorMessage: null, + ), + ); try { final response = await _repository.signupStart( @@ -201,6 +207,7 @@ class RegisterCubit extends Cubit { emit( state.copyWith( isSending: false, + status: FormzSubmissionStatus.success, pendingEmail: response.email, codeSent: true, errorMessage: null,