feat(apps): refine login consent and calendar day/month UX
This commit is contained in:
@@ -130,6 +130,7 @@ class LoginCubit extends Cubit<LoginState> {
|
||||
|
||||
final requestPhone = state.e164Phone;
|
||||
emit(state.copyWith(isSendingCode: true, errorMessage: null));
|
||||
_startResendCooldown();
|
||||
try {
|
||||
await _repository.sendOtp(requestPhone);
|
||||
if (isClosed) {
|
||||
@@ -146,7 +147,6 @@ class LoginCubit extends Cubit<LoginState> {
|
||||
errorMessage: null,
|
||||
),
|
||||
);
|
||||
_startResendCooldown();
|
||||
return true;
|
||||
} catch (e) {
|
||||
if (isClosed) {
|
||||
|
||||
@@ -54,6 +54,12 @@ class _LoginViewState extends State<LoginView> {
|
||||
}
|
||||
|
||||
Future<void> _handleLogin() async {
|
||||
if (!_agreedToTerms) {
|
||||
final confirmed = await _showAgreementDialog();
|
||||
if (!confirmed || !mounted) return;
|
||||
setState(() => _agreedToTerms = true);
|
||||
}
|
||||
|
||||
final cubit = context.read<LoginCubit>();
|
||||
cubit.phoneChanged(_phoneController.text);
|
||||
cubit.codeChanged(_codeController.text);
|
||||
@@ -70,12 +76,6 @@ class _LoginViewState extends State<LoginView> {
|
||||
}
|
||||
|
||||
Future<void> _handleSendCode() async {
|
||||
if (!_agreedToTerms) {
|
||||
final confirmed = await _showAgreementDialog();
|
||||
if (!confirmed || !mounted) return;
|
||||
setState(() => _agreedToTerms = true);
|
||||
}
|
||||
|
||||
final cubit = context.read<LoginCubit>();
|
||||
cubit.phoneChanged(_phoneController.text);
|
||||
final sent = await cubit.sendCode();
|
||||
|
||||
Reference in New Issue
Block a user