Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

fix: dispose the listener when the favorite bloc dispose (#3103)

Lucas.Xua40c639a9690
diff --git a/frontend/appflowy_flutter/lib/workspace/application/favorite/favorite_bloc.dart b/frontend/appflowy_flutter/lib/workspace/application/favorite/favorite_bloc.dart
index 5c7227abf4..7a664cd3c3 100644
--- a/frontend/appflowy_flutter/lib/workspace/application/favorite/favorite_bloc.dart
+++ b/frontend/appflowy_flutter/lib/workspace/application/favorite/favorite_bloc.dart
@@ -58,6 +58,12 @@ class FavoriteBloc extends Bloc<FavoriteEvent, FavoriteState> {
);
}
+ @override
+ Future<void> close() async {
+ await _listener.stop();
+ return super.close();
+ }
+
void _onFavoritesUpdated(
Either<FlowyError, RepeatedViewPB> favoriteOrFailed,
bool didFavorite,