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
3838
3939 final AuthRepository _authenticationRepository;
4040 late final StreamSubscription <User ?> _userAuthSubscription;
41+ Timer ? _cooldownTimer;
4142
4243 /// Handles [_AuthenticationUserChanged] events.
4344 Future <void > _onAuthenticationUserChanged (
@@ -83,7 +84,8 @@ class AuthenticationBloc
8384 ),
8485 );
8586
86- Timer (
87+ _cooldownTimer? .cancel ();
88+ _cooldownTimer = Timer (
8789 _requestCodeCooldownDuration,
8890 () => add (const AuthenticationCooldownCompleted ()),
8991 );
@@ -168,6 +170,7 @@ class AuthenticationBloc
168170 @override
169171 Future <void > close () {
170172 _userAuthSubscription.cancel ();
173+ _cooldownTimer? .cancel ();
171174 return super .close ();
172175 }
173176
Original file line number Diff line number Diff line change @@ -200,9 +200,6 @@ class _EmailLinkFormState extends State<_EmailLinkForm> {
200200 setState (() {
201201 _cooldownSeconds = 0 ;
202202 });
203- context
204- .read <AuthenticationBloc >()
205- .add (const AuthenticationCooldownCompleted ());
206203 }
207204 });
208205 }
You can’t perform that action at this time.
0 commit comments