chore: Follow up homeserverpicker UX
This commit is contained in:
parent
2f39b1e8f4
commit
65fd8a4184
2 changed files with 8 additions and 5 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue