mirror of
https://github.com/kodjodevf/mangayomi.git
synced 2026-01-11 22:40:36 +00:00
Fix invalid selection
Don't show manga calendar if manga is hidden.
This commit is contained in:
parent
a2a10a799d
commit
2c92d74a03
1 changed files with 8 additions and 2 deletions
|
|
@ -38,15 +38,21 @@ class _CalendarScreenState extends ConsumerState<CalendarScreen> {
|
|||
DateTime? _selectedDay;
|
||||
DateTime? _rangeStart;
|
||||
DateTime? _rangeEnd;
|
||||
late ItemType? itemType = widget.itemType ?? ItemType.manga;
|
||||
late ItemType? itemType;
|
||||
late List<ItemType> _visibleTypes;
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
_visibleTypes = hiddenItemTypes(ref.read(hideItemsStateProvider));
|
||||
final initialItemType = widget.itemType ?? ItemType.manga;
|
||||
if (_visibleTypes.contains(initialItemType)) {
|
||||
itemType = initialItemType;
|
||||
} else {
|
||||
itemType = _visibleTypes.isNotEmpty ? _visibleTypes.first : null;
|
||||
}
|
||||
_selectedDay = _focusedDay;
|
||||
_selectedEntries = ValueNotifier([]);
|
||||
_visibleTypes = hiddenItemTypes(ref.read(hideItemsStateProvider));
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
|
|||
Loading…
Reference in a new issue