|
|
@ -36,7 +36,7 @@ abstract interface class AppsBlocStates { |
|
|
|
|
|
|
|
|
|
|
|
BehaviorSubject<void> get openNotifications; |
|
|
|
BehaviorSubject<void> get openNotifications; |
|
|
|
|
|
|
|
|
|
|
|
BehaviorSubject<Iterable<(String, Object?)>?> get appVersions; |
|
|
|
BehaviorSubject<Map<String, String?>> get appVersions; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@internal |
|
|
|
@internal |
|
|
@ -116,24 +116,23 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
final appIds = { |
|
|
|
final notSupported = <String, String?>{}; |
|
|
|
'core', |
|
|
|
|
|
|
|
...apps.requireData.map((final a) => a.id), |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
final notSupported = <(String, Object?)>[]; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (final id in appIds) { |
|
|
|
|
|
|
|
try { |
|
|
|
try { |
|
|
|
final (supported, minVersion) = switch (id) { |
|
|
|
final (coreSupported, coreMinimumVersion) = _account.client.core.isSupported(capabilities.requireData); |
|
|
|
'core' => _account.client.core.isSupported(capabilities.requireData), |
|
|
|
if (!coreSupported) { |
|
|
|
AppIDs.news => await _account.client.news.isSupported(), |
|
|
|
notSupported['core'] = coreMinimumVersion.toString(); |
|
|
|
AppIDs.notes => _account.client.notes.isSupported(capabilities.requireData), |
|
|
|
} |
|
|
|
_ => (true, null), |
|
|
|
} catch (e, s) { |
|
|
|
}; |
|
|
|
debugPrint(e.toString()); |
|
|
|
|
|
|
|
debugPrint(s.toString()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!supported) { |
|
|
|
for (final app in apps.requireData) { |
|
|
|
notSupported.add((id, minVersion)); |
|
|
|
try { |
|
|
|
|
|
|
|
final (supported, minimumVersion) = await app.isSupported(_account, capabilities.requireData); |
|
|
|
|
|
|
|
if (!(supported ?? true)) { |
|
|
|
|
|
|
|
notSupported[app.id] = minimumVersion; |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (e, s) { |
|
|
|
} catch (e, s) { |
|
|
|
debugPrint(e.toString()); |
|
|
|
debugPrint(e.toString()); |
|
|
@ -193,7 +192,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates |
|
|
|
BehaviorSubject<void> openNotifications = BehaviorSubject(); |
|
|
|
BehaviorSubject<void> openNotifications = BehaviorSubject(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
BehaviorSubject<List<(String, Object?)>?> appVersions = BehaviorSubject(); |
|
|
|
BehaviorSubject<Map<String, String?>> appVersions = BehaviorSubject(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
Future<void> refresh() async { |
|
|
|
Future<void> refresh() async { |
|
|
|