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();
|
_checkHomeserverCooldown?.cancel();
|
||||||
_lastCheckedUrl = null;
|
_lastCheckedUrl = null;
|
||||||
checkHomeserverAction();
|
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
|
/// 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
|
/// 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
|
/// well-known information and forwards to the login page depending on the
|
||||||
|
|
|
||||||
|
|
@ -137,10 +137,7 @@ class HomeserverPickerView extends StatelessWidget {
|
||||||
TextField(
|
TextField(
|
||||||
onChanged:
|
onChanged:
|
||||||
controller.tryCheckHomeserverActionWithCooldown,
|
controller.tryCheckHomeserverActionWithCooldown,
|
||||||
onEditingComplete: controller
|
onSubmitted: controller.onSubmitted,
|
||||||
.tryCheckHomeserverActionWithoutCooldown,
|
|
||||||
onSubmitted: controller
|
|
||||||
.tryCheckHomeserverActionWithoutCooldown,
|
|
||||||
onTap:
|
onTap:
|
||||||
controller.tryCheckHomeserverActionWithCooldown,
|
controller.tryCheckHomeserverActionWithCooldown,
|
||||||
controller: controller.homeserverController,
|
controller: controller.homeserverController,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue