mirror of
https://github.com/szkolny-eu/szkolny-android.git
synced 2025-01-31 13:48:20 +01:00
[Timetable] Fix showing "no timetable" when all nearest lessons are cancelled. Fix a crash in timetable fragment.
This commit is contained in:
parent
ae89b33fb7
commit
df1a241b2b
@ -166,8 +166,8 @@ class HomeTimetableCard(
|
|||||||
&& !(it.isCancelled && ignoreCancelled)
|
&& !(it.isCancelled && ignoreCancelled)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lessons.isEmpty() && timetableDate.weekDay <= 5)
|
//if (lessons.isEmpty() && timetableDate.weekDay <= 5)
|
||||||
break
|
// break
|
||||||
|
|
||||||
checkedDays++
|
checkedDays++
|
||||||
}
|
}
|
||||||
|
@ -124,6 +124,8 @@ class TimetableFragment : Fragment(), CoroutineScope {
|
|||||||
endHour = lessonRanges.map { it.endTime.hour }.max()?.plus(1) ?: DEFAULT_END_HOUR
|
endHour = lessonRanges.map { it.endTime.hour }.max()?.plus(1) ?: DEFAULT_END_HOUR
|
||||||
}
|
}
|
||||||
deferred.await()
|
deferred.await()
|
||||||
|
if (!isAdded)
|
||||||
|
return@launch
|
||||||
|
|
||||||
val pagerAdapter = TimetablePagerAdapter(
|
val pagerAdapter = TimetablePagerAdapter(
|
||||||
fragmentManager ?: return@launch,
|
fragmentManager ?: return@launch,
|
||||||
|
@ -229,8 +229,8 @@ class WidgetTimetableProvider : AppWidgetProvider() {
|
|||||||
&& !(it.isCancelled && ignoreCancelled)
|
&& !(it.isCancelled && ignoreCancelled)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lessons.isEmpty() && timetableDate.weekDay <= 5)
|
//if (lessons.isEmpty() && timetableDate.weekDay <= 5)
|
||||||
break
|
// break
|
||||||
|
|
||||||
checkedDays++
|
checkedDays++
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user