|
|
@ -60,20 +60,13 @@ class _HomePageState extends State<HomePage> { |
|
|
|
...appsResult.data!.map((final a) => a.id), |
|
|
|
...appsResult.data!.map((final a) => a.id), |
|
|
|
]) { |
|
|
|
]) { |
|
|
|
try { |
|
|
|
try { |
|
|
|
bool? supported; |
|
|
|
final (supported, _) = switch (id) { |
|
|
|
switch (id) { |
|
|
|
'core' => await widget.account.client.core.isSupported(result.data), |
|
|
|
case 'core': |
|
|
|
'news' => await widget.account.client.news.isSupported(), |
|
|
|
supported = await widget.account.client.core.isSupported(result.data); |
|
|
|
'notes' => await widget.account.client.notes.isSupported(result.data), |
|
|
|
break; |
|
|
|
_ => (true, null), |
|
|
|
case 'news': |
|
|
|
}; |
|
|
|
supported = await widget.account.client.news.isSupported(); |
|
|
|
if (supported || !mounted) { |
|
|
|
break; |
|
|
|
|
|
|
|
case 'notes': |
|
|
|
|
|
|
|
supported = await widget.account.client.notes.isSupported(result.data); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
if (!(supported ?? true)) { |
|
|
|
|
|
|
|
if (!mounted) { |
|
|
|
|
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
var name = AppLocalizations.of(context).appImplementationName(id); |
|
|
|
var name = AppLocalizations.of(context).appImplementationName(id); |
|
|
@ -83,7 +76,6 @@ class _HomePageState extends State<HomePage> { |
|
|
|
await _showProblem( |
|
|
|
await _showProblem( |
|
|
|
AppLocalizations.of(context).errorUnsupportedVersion(name), |
|
|
|
AppLocalizations.of(context).errorUnsupportedVersion(name), |
|
|
|
); |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} catch (e, s) { |
|
|
|
} catch (e, s) { |
|
|
|
debugPrint(e.toString()); |
|
|
|
debugPrint(e.toString()); |
|
|
|
debugPrint(s.toString()); |
|
|
|
debugPrint(s.toString()); |
|
|
|