Skip to content

Commit fd82b19

Browse files
committed
fix(authentication): improve cooldown timer check
- Update cooldown timer condition to ensure it only starts when cooldownEndTime is in the future - Remove redundant status check for better readability
1 parent cc5f197 commit fd82b19

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/authentication/view/request_code_page.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,8 @@ class _EmailLinkFormState extends State<_EmailLinkForm> {
192192
void initState() {
193193
super.initState();
194194
final authState = context.read<AuthenticationBloc>().state;
195-
if (authState.status == AuthenticationStatus.requestCodeCooldown &&
196-
authState.cooldownEndTime != null) {
195+
if (authState.cooldownEndTime != null &&
196+
authState.cooldownEndTime!.isAfter(DateTime.now())) {
197197
_startCooldownTimer(authState.cooldownEndTime!);
198198
}
199199
}

0 commit comments

Comments
 (0)