mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-01-19 06:36:53 -06:00
Fix date in attendance and timetable when day is changing (#1893)
This commit is contained in:
parent
bfab265ccf
commit
0a2eb07844
@ -91,15 +91,19 @@ class AttendancePresenter @Inject constructor(
|
|||||||
|
|
||||||
fun onViewReselected() {
|
fun onViewReselected() {
|
||||||
Timber.i("Attendance view is reselected")
|
Timber.i("Attendance view is reselected")
|
||||||
view?.also { view ->
|
view?.let { view ->
|
||||||
if (view.currentStackSize == 1) {
|
if (view.currentStackSize == 1) {
|
||||||
baseDate.also {
|
baseDate = now().previousOrSameSchoolDay
|
||||||
if (currentDate != it) {
|
|
||||||
reloadView(it)
|
if (currentDate != baseDate) {
|
||||||
|
reloadView(baseDate)
|
||||||
loadData()
|
loadData()
|
||||||
} else if (!view.isViewEmpty) view.resetView()
|
} else if (!view.isViewEmpty) {
|
||||||
|
view.resetView()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
view.popView()
|
||||||
}
|
}
|
||||||
} else view.popView()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,15 +87,19 @@ class TimetablePresenter @Inject constructor(
|
|||||||
|
|
||||||
fun onViewReselected() {
|
fun onViewReselected() {
|
||||||
Timber.i("Timetable view is reselected")
|
Timber.i("Timetable view is reselected")
|
||||||
view?.also { view ->
|
view?.let { view ->
|
||||||
if (view.currentStackSize == 1) {
|
if (view.currentStackSize == 1) {
|
||||||
baseDate.also {
|
baseDate = now().nextOrSameSchoolDay
|
||||||
if (currentDate != it) {
|
|
||||||
reloadView(it)
|
if (currentDate != baseDate) {
|
||||||
|
reloadView(baseDate)
|
||||||
loadData()
|
loadData()
|
||||||
} else if (!view.isViewEmpty) view.resetView()
|
} else if (!view.isViewEmpty) {
|
||||||
|
view.resetView()
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
view.popView()
|
||||||
}
|
}
|
||||||
} else view.popView()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user