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 {
|
Future<void> sendCodeSilently() async {
|
||||||
if (!state.isStep1Valid || state.isSending) return;
|
if (!state.isStep1Valid || state.isSending) return;
|
||||||
|
|
||||||
emit(state.copyWith(isSending: true));
|
emit(
|
||||||
|
state.copyWith(
|
||||||
|
isSending: true,
|
||||||
|
status: FormzSubmissionStatus.inProgress,
|
||||||
|
errorMessage: null,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
final response = await _repository.signupStart(
|
final response = await _repository.signupStart(
|
||||||
@@ -201,6 +207,7 @@ class RegisterCubit extends Cubit<RegisterState> {
|
|||||||
emit(
|
emit(
|
||||||
state.copyWith(
|
state.copyWith(
|
||||||
isSending: false,
|
isSending: false,
|
||||||
|
status: FormzSubmissionStatus.success,
|
||||||
pendingEmail: response.email,
|
pendingEmail: response.email,
|
||||||
codeSent: true,
|
codeSent: true,
|
||||||
errorMessage: null,
|
errorMessage: null,
|
||||||
|
|||||||
Reference in New Issue
Block a user