mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-05-12 21:50:37 +00:00
Cleanup
Use getCurrentItemType() method to determine the ItemType of the current tab instead of the conditional with `_tabBarController.index`, which doesn't take into account that there could be hidden tabs.
This commit is contained in:
parent
da566d3d0b
commit
67a83c0e6a
1 changed files with 3 additions and 11 deletions
|
|
@ -34,14 +34,8 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
bool _isLoading = false;
|
||||
|
||||
Future<void> _updateLibrary() async {
|
||||
setState(() {
|
||||
_isLoading = true;
|
||||
});
|
||||
final itemType = _tabBarController.index == 0
|
||||
? ItemType.manga
|
||||
: _tabBarController.index == 1
|
||||
? ItemType.anime
|
||||
: ItemType.novel;
|
||||
setState(() => _isLoading = true);
|
||||
final itemType = getCurrentItemType();
|
||||
final mangaList = isar.mangas
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
|
|
@ -57,9 +51,7 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
mangaList: mangaList,
|
||||
itemType: itemType,
|
||||
);
|
||||
setState(() {
|
||||
_isLoading = false;
|
||||
});
|
||||
setState(() => _isLoading = false);
|
||||
}
|
||||
|
||||
void tabListener() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue