mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-16 18:56:00 -07:00
[Bugfix] Fixed refreshing details screens
This commit is contained in:
parent
8bda03ee2c
commit
aaa6a737cb
4 changed files with 10 additions and 13 deletions
|
|
@ -27,16 +27,12 @@ class SeriesDetailViewNotifier extends StateNotifier<SeriesModel?> {
|
|||
Future<Response?> fetchDetails(ItemBaseModel seriesModel) async {
|
||||
try {
|
||||
if (seriesModel is SeriesModel) {
|
||||
state = seriesModel;
|
||||
state = state ?? seriesModel;
|
||||
}
|
||||
SeriesModel? newState;
|
||||
final response = await api.usersUserIdItemsItemIdGet(itemId: seriesModel.id);
|
||||
if (response.body == null) {
|
||||
state = seriesModel as SeriesModel;
|
||||
return null;
|
||||
}
|
||||
if (response.body == null) return null;
|
||||
newState = response.bodyOrThrow as SeriesModel;
|
||||
|
||||
final seasons = await api.showsSeriesIdSeasonsGet(seriesId: seriesModel.id);
|
||||
newState = newState.copyWith(seasons: SeasonModel.seasonsFromDto(seasons.body?.items, ref));
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue