mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-01-11 22:40:36 +00:00
remove hideItems parameter
No need to pass hideItems down, they all can use the top hideItems variable. It's never changed.
This commit is contained in:
parent
c911594e73
commit
da566d3d0b
1 changed files with 4 additions and 7 deletions
|
|
@ -167,7 +167,7 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
TextButton(
|
||||
onPressed: () async {
|
||||
if (mounted) Navigator.pop(context);
|
||||
await _clearUpdates(hideItems);
|
||||
await _clearUpdates();
|
||||
},
|
||||
child: Text(l10n.ok),
|
||||
),
|
||||
|
|
@ -247,14 +247,11 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
);
|
||||
}
|
||||
|
||||
Future<void> _clearUpdates(List<String> hideItems) async {
|
||||
Future<void> _clearUpdates() async {
|
||||
List<Update> updates = await isar.updates
|
||||
.filter()
|
||||
.idIsNotNull()
|
||||
.chapter(
|
||||
(q) =>
|
||||
q.manga((q) => q.itemTypeEqualTo(getCurrentItemType(hideItems))),
|
||||
)
|
||||
.chapter((q) => q.manga((q) => q.itemTypeEqualTo(getCurrentItemType())))
|
||||
.findAll();
|
||||
final idsToDelete = <Id>[];
|
||||
isar.writeTxnSync(() {
|
||||
|
|
@ -268,7 +265,7 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
|
|||
await isar.writeTxn(() => isar.updates.deleteAll(idsToDelete));
|
||||
}
|
||||
|
||||
ItemType getCurrentItemType(List<String> hideItems) {
|
||||
ItemType getCurrentItemType() {
|
||||
return _tabBarController.index == 0 && !hideItems.contains("/MangaLibrary")
|
||||
? ItemType.manga
|
||||
: _tabBarController.index ==
|
||||
|
|
|
|||
Loading…
Reference in a new issue