Browse Source

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

Lucas.Xu 1 year ago
parent
commit
a40c639a96

+ 6 - 0
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,