fix(auth): reset state properly in sendCodeSilently
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user