From 643a5c33274d9390259264a2c50c28a8e9e44ca0 Mon Sep 17 00:00:00 2001 From: Nikolas Rimikis Date: Fri, 29 Sep 2023 21:50:51 +0200 Subject: [PATCH] refactor(neon): remove apps subject from AppsBlocStates Signed-off-by: Nikolas Rimikis --- packages/neon/neon/lib/src/blocs/apps.dart | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/neon/neon/lib/src/blocs/apps.dart b/packages/neon/neon/lib/src/blocs/apps.dart index 5bf324c3..b3716a3a 100644 --- a/packages/neon/neon/lib/src/blocs/apps.dart +++ b/packages/neon/neon/lib/src/blocs/apps.dart @@ -27,8 +27,6 @@ abstract interface class AppsBlocEvents { @internal abstract interface class AppsBlocStates { - BehaviorSubject>> get apps; - BehaviorSubject>> get appImplementations; BehaviorSubject> 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 _allAppImplementations; + final _apps = BehaviorSubject>>(); @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>>> appImplementations = BehaviorSubject(); - @override - BehaviorSubject>> apps = BehaviorSubject(); - @override BehaviorSubject> 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(), );