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:
NBA2K1 2025-12-28 23:16:29 +01:00
parent c911594e73
commit da566d3d0b

View file

@ -167,7 +167,7 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
TextButton( TextButton(
onPressed: () async { onPressed: () async {
if (mounted) Navigator.pop(context); if (mounted) Navigator.pop(context);
await _clearUpdates(hideItems); await _clearUpdates();
}, },
child: Text(l10n.ok), 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 List<Update> updates = await isar.updates
.filter() .filter()
.idIsNotNull() .idIsNotNull()
.chapter( .chapter((q) => q.manga((q) => q.itemTypeEqualTo(getCurrentItemType())))
(q) =>
q.manga((q) => q.itemTypeEqualTo(getCurrentItemType(hideItems))),
)
.findAll(); .findAll();
final idsToDelete = <Id>[]; final idsToDelete = <Id>[];
isar.writeTxnSync(() { isar.writeTxnSync(() {
@ -268,7 +265,7 @@ class _UpdatesScreenState extends ConsumerState<UpdatesScreen>
await isar.writeTxn(() => isar.updates.deleteAll(idsToDelete)); await isar.writeTxn(() => isar.updates.deleteAll(idsToDelete));
} }
ItemType getCurrentItemType(List<String> hideItems) { ItemType getCurrentItemType() {
return _tabBarController.index == 0 && !hideItems.contains("/MangaLibrary") return _tabBarController.index == 0 && !hideItems.contains("/MangaLibrary")
? ItemType.manga ? ItemType.manga
: _tabBarController.index == : _tabBarController.index ==