fix(ui): Fix adding anime or manga

This commit is contained in:
PapaTutuWawa 2023-02-08 20:25:20 +01:00
parent e12b9a0c72
commit 5cd3909c4d

View File

@ -59,17 +59,11 @@ class AnimeListBloc extends Bloc<AnimeListEvent, AnimeListState> {
// Add it to the cache // Add it to the cache
_animes.add(event.data); _animes.add(event.data);
if (event.data.state == state.animeFilterState || emit(
state.animeFilterState == MediumTrackingState.all) { state.copyWith(
emit( animes: _getFilteredAnime(),
state.copyWith( ),
animes: List.from([ );
...state.animes,
event.data,
]),
),
);
}
} }
Future<void> _onMangaAdded(MangaAddedEvent event, Emitter<AnimeListState> emit) async { Future<void> _onMangaAdded(MangaAddedEvent event, Emitter<AnimeListState> emit) async {
@ -79,17 +73,11 @@ class AnimeListBloc extends Bloc<AnimeListEvent, AnimeListState> {
// Add it to the cache // Add it to the cache
_mangas.add(event.data); _mangas.add(event.data);
if (event.data.state == state.mangaFilterState || emit(
state.mangaFilterState == MediumTrackingState.all) { state.copyWith(
emit( mangas: _getFilteredManga(),
state.copyWith( ),
mangas: List.from([ );
...state.mangas,
event.data,
]),
),
);
}
} }
Future<void> _onAnimeIncremented(AnimeEpisodeIncrementedEvent event, Emitter<AnimeListState> emit) async { Future<void> _onAnimeIncremented(AnimeEpisodeIncrementedEvent event, Emitter<AnimeListState> emit) async {