fix(auth): reset state properly in sendCodeSilently

This commit is contained in:
qzl
2026-02-26 11:28:33 +08:00
parent 4f9889bb3f
commit a6fbf70ad5
@@ -188,7 +188,13 @@ class RegisterCubit extends Cubit<RegisterState> {
Future<void> 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<RegisterState> {
emit(
state.copyWith(
isSending: false,
status: FormzSubmissionStatus.success,
pendingEmail: response.email,
codeSent: true,
errorMessage: null,