|
|
@ -27,8 +27,6 @@ abstract interface class AppsBlocEvents { |
|
|
|
|
|
|
|
|
|
|
|
@internal |
|
|
|
@internal |
|
|
|
abstract interface class AppsBlocStates { |
|
|
|
abstract interface class AppsBlocStates { |
|
|
|
BehaviorSubject<Result<List<core.NavigationEntry>>> get apps; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BehaviorSubject<Result<Iterable<AppImplementation>>> get appImplementations; |
|
|
|
BehaviorSubject<Result<Iterable<AppImplementation>>> get appImplementations; |
|
|
|
|
|
|
|
|
|
|
|
BehaviorSubject<Result<NotificationsAppInterface?>> get notificationsAppImplementation; |
|
|
|
BehaviorSubject<Result<NotificationsAppInterface?>> get notificationsAppImplementation; |
|
|
@ -48,7 +46,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates |
|
|
|
this._account, |
|
|
|
this._account, |
|
|
|
this._allAppImplementations, |
|
|
|
this._allAppImplementations, |
|
|
|
) { |
|
|
|
) { |
|
|
|
apps.listen((final result) { |
|
|
|
_apps.listen((final result) { |
|
|
|
appImplementations |
|
|
|
appImplementations |
|
|
|
.add(result.transform((final data) => _filteredAppImplementations(data.map((final a) => a.id)))); |
|
|
|
.add(result.transform((final data) => _filteredAppImplementations(data.map((final a) => a.id)))); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -162,10 +160,11 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates |
|
|
|
final AccountsBloc _accountsBloc; |
|
|
|
final AccountsBloc _accountsBloc; |
|
|
|
final Account _account; |
|
|
|
final Account _account; |
|
|
|
final Iterable<AppImplementation> _allAppImplementations; |
|
|
|
final Iterable<AppImplementation> _allAppImplementations; |
|
|
|
|
|
|
|
final _apps = BehaviorSubject<Result<List<core.NavigationEntry>>>(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
void dispose() { |
|
|
|
void dispose() { |
|
|
|
unawaited(apps.close()); |
|
|
|
unawaited(_apps.close()); |
|
|
|
unawaited(appImplementations.close()); |
|
|
|
unawaited(appImplementations.close()); |
|
|
|
unawaited(notificationsAppImplementation.close()); |
|
|
|
unawaited(notificationsAppImplementation.close()); |
|
|
|
unawaited(activeApp.close()); |
|
|
|
unawaited(activeApp.close()); |
|
|
@ -182,9 +181,6 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates |
|
|
|
BehaviorSubject<Result<Iterable<AppImplementation<Bloc, NextcloudAppOptions>>>> appImplementations = |
|
|
|
BehaviorSubject<Result<Iterable<AppImplementation<Bloc, NextcloudAppOptions>>>> appImplementations = |
|
|
|
BehaviorSubject(); |
|
|
|
BehaviorSubject(); |
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
|
|
|
BehaviorSubject<Result<List<core.NavigationEntry>>> apps = BehaviorSubject(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@override |
|
|
|
@override |
|
|
|
BehaviorSubject<Result<NotificationsAppInterface?>> notificationsAppImplementation = BehaviorSubject(); |
|
|
|
BehaviorSubject<Result<NotificationsAppInterface?>> notificationsAppImplementation = BehaviorSubject(); |
|
|
|
|
|
|
|
|
|
|
@ -199,7 +195,7 @@ class AppsBloc extends InteractiveBloc implements AppsBlocEvents, AppsBlocStates |
|
|
|
await RequestManager.instance.wrapNextcloud( |
|
|
|
await RequestManager.instance.wrapNextcloud( |
|
|
|
_account.id, |
|
|
|
_account.id, |
|
|
|
'apps-apps', |
|
|
|
'apps-apps', |
|
|
|
apps, |
|
|
|
_apps, |
|
|
|
_account.client.core.navigation.getAppsNavigationRaw(), |
|
|
|
_account.client.core.navigation.getAppsNavigationRaw(), |
|
|
|
(final response) => response.body.ocs.data.toList(), |
|
|
|
(final response) => response.body.ocs.data.toList(), |
|
|
|
); |
|
|
|
); |
|
|
|