chore: Improved error handling for recovery key
This commit is contained in:
parent
74b1553662
commit
2af8691536
2 changed files with 17 additions and 9 deletions
|
|
@ -163,15 +163,16 @@ class HomeserverPickerController extends State<HomeserverPicker> {
|
|||
List<IdentityProvider>? get identityProviders {
|
||||
final loginTypes = _rawLoginTypes;
|
||||
if (loginTypes == null) return null;
|
||||
final List? rawProviders = loginTypes.tryGetList('flows')!.singleWhere(
|
||||
(flow) => flow['type'] == AuthenticationTypes.sso,
|
||||
)['identity_providers'] ??
|
||||
[
|
||||
{'id': null},
|
||||
];
|
||||
final list = (rawProviders as List)
|
||||
.map((json) => IdentityProvider.fromJson(json))
|
||||
.toList();
|
||||
final List? rawProviders =
|
||||
loginTypes.tryGetList('flows')?.singleWhereOrNull(
|
||||
(flow) => flow['type'] == AuthenticationTypes.sso,
|
||||
)['identity_providers'] ??
|
||||
[
|
||||
{'id': null},
|
||||
];
|
||||
if (rawProviders == null) return null;
|
||||
final list =
|
||||
rawProviders.map((json) => IdentityProvider.fromJson(json)).toList();
|
||||
if (PlatformInfos.isCupertinoStyle) {
|
||||
list.sort((a, b) => a.brand == 'apple' ? -1 : 1);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue