Browse Source

refactor(neon): remove apps subject from AppsBlocStates

Signed-off-by: Nikolas Rimikis <leptopoda@users.noreply.github.com>
pull/886/head
Nikolas Rimikis 1 year ago
parent
commit
643a5c3327
No known key found for this signature in database
GPG Key ID: 85ED1DE9786A4FF2
  1. 12
      packages/neon/neon/lib/src/blocs/apps.dart

12
packages/neon/neon/lib/src/blocs/apps.dart

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

Loading…
Cancel
Save