File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ class AuthenticationBloc
38
38
39
39
final AuthRepository _authenticationRepository;
40
40
late final StreamSubscription <User ?> _userAuthSubscription;
41
+ Timer ? _cooldownTimer;
41
42
42
43
/// Handles [_AuthenticationUserChanged] events.
43
44
Future <void > _onAuthenticationUserChanged (
@@ -83,7 +84,8 @@ class AuthenticationBloc
83
84
),
84
85
);
85
86
86
- Timer (
87
+ _cooldownTimer? .cancel ();
88
+ _cooldownTimer = Timer (
87
89
_requestCodeCooldownDuration,
88
90
() => add (const AuthenticationCooldownCompleted ()),
89
91
);
@@ -168,6 +170,7 @@ class AuthenticationBloc
168
170
@override
169
171
Future <void > close () {
170
172
_userAuthSubscription.cancel ();
173
+ _cooldownTimer? .cancel ();
171
174
return super .close ();
172
175
}
173
176
Original file line number Diff line number Diff line change @@ -200,9 +200,6 @@ class _EmailLinkFormState extends State<_EmailLinkForm> {
200
200
setState (() {
201
201
_cooldownSeconds = 0 ;
202
202
});
203
- context
204
- .read <AuthenticationBloc >()
205
- .add (const AuthenticationCooldownCompleted ());
206
203
}
207
204
});
208
205
}
You can’t perform that action at this time.
0 commit comments