mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-04-21 16:01:58 +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(
|
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 ==
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue