mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-12-18 10:52:34 +01:00
fix: Dont rerun server checks
This commit is contained in:
parent
7d6a10e7a5
commit
3126ce27f9
@ -103,13 +103,15 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
|||||||
_intentDataStreamSubscription?.cancel();
|
_intentDataStreamSubscription?.cancel();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
String _lastCheckedHomeserver;
|
||||||
|
|
||||||
/// 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
|
||||||
/// login type.
|
/// login type.
|
||||||
Future<void> checkHomeserverAction() async {
|
Future<void> checkHomeserverAction() async {
|
||||||
_coolDown?.cancel();
|
_coolDown?.cancel();
|
||||||
try {
|
if (_lastCheckedHomeserver == domain) return;
|
||||||
if (domain.isEmpty) throw L10n.of(context).changeTheHomeserver;
|
if (domain.isEmpty) throw L10n.of(context).changeTheHomeserver;
|
||||||
var homeserver = domain;
|
var homeserver = domain;
|
||||||
|
|
||||||
@ -121,6 +123,8 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
|||||||
error = _rawLoginTypes = registrationSupported = null;
|
error = _rawLoginTypes = registrationSupported = null;
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
try {
|
||||||
final wellKnown =
|
final wellKnown =
|
||||||
await Matrix.of(context).getLoginClient().checkHomeserver(homeserver);
|
await Matrix.of(context).getLoginClient().checkHomeserver(homeserver);
|
||||||
|
|
||||||
@ -151,6 +155,7 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
setState(() => error = (e as Object).toLocalizedString(context));
|
setState(() => error = (e as Object).toLocalizedString(context));
|
||||||
} finally {
|
} finally {
|
||||||
|
_lastCheckedHomeserver = domain;
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
setState(() => isLoading = false);
|
setState(() => isLoading = false);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user