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

This commit is contained in:
Lucas.Xu 2023-08-03 07:50:56 +07:00 committed by GitHub
parent ea0c4e96d2
commit a40c639a96
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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,