chore: Follow up homeserverpicker UX

This commit is contained in:
Krille 2024-11-03 14:39:22 +01:00
parent 2f39b1e8f4
commit 65fd8a4184
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
2 changed files with 8 additions and 5 deletions

View file

@ -73,12 +73,18 @@ class HomeserverPickerController extends State<HomeserverPicker> {
);
}
tryCheckHomeserverActionWithoutCooldown([_]) {
void tryCheckHomeserverActionWithoutCooldown([_]) {
_checkHomeserverCooldown?.cancel();
_lastCheckedUrl = null;
checkHomeserverAction();
}
void onSubmitted([_]) {
if (supportsSso) return ssoLoginAction();
if (supportsPasswordLogin) return login();
return tryCheckHomeserverActionWithoutCooldown();
}
/// Starts an analysis of the given homeserver. It uses the current domain and
/// makes sure that it is prefixed with https. Then it searches for the
/// well-known information and forwards to the login page depending on the

View file

@ -137,10 +137,7 @@ class HomeserverPickerView extends StatelessWidget {
TextField(
onChanged:
controller.tryCheckHomeserverActionWithCooldown,
onEditingComplete: controller
.tryCheckHomeserverActionWithoutCooldown,
onSubmitted: controller
.tryCheckHomeserverActionWithoutCooldown,
onSubmitted: controller.onSubmitted,
onTap:
controller.tryCheckHomeserverActionWithCooldown,
controller: controller.homeserverController,