mirror of
https://github.com/wulkanowy/wulkanowy.git
synced 2025-02-21 19:44:45 +01:00
Fix infinite refresh when admin messages list is empty (#1587)
This commit is contained in:
parent
e7550f7a43
commit
4c8d9c8f7f
@ -620,6 +620,8 @@ class DashboardPresenter @Inject constructor(
|
|||||||
|
|
||||||
if (dashboardItem is DashboardItem.AdminMessages && !dashboardItem.isDataLoaded) {
|
if (dashboardItem is DashboardItem.AdminMessages && !dashboardItem.isDataLoaded) {
|
||||||
dashboardItemsToLoad = dashboardItemsToLoad - DashboardItem.Type.ADMIN_MESSAGE
|
dashboardItemsToLoad = dashboardItemsToLoad - DashboardItem.Type.ADMIN_MESSAGE
|
||||||
|
dashboardTileLoadedList = dashboardTileLoadedList - DashboardItem.Tile.ADMIN_MESSAGE
|
||||||
|
|
||||||
dashboardItemLoadedList.removeAll { it.type == DashboardItem.Type.ADMIN_MESSAGE }
|
dashboardItemLoadedList.removeAll { it.type == DashboardItem.Type.ADMIN_MESSAGE }
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -654,9 +656,12 @@ class DashboardPresenter @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun updateForceRefreshData(dashboardItem: DashboardItem) {
|
private fun updateForceRefreshData(dashboardItem: DashboardItem) {
|
||||||
|
val isNotLoadedAdminMessage =
|
||||||
|
dashboardItem is DashboardItem.AdminMessages && !dashboardItem.isDataLoaded
|
||||||
|
|
||||||
with(dashboardItemRefreshLoadedList) {
|
with(dashboardItemRefreshLoadedList) {
|
||||||
removeAll { it.type == dashboardItem.type }
|
removeAll { it.type == dashboardItem.type }
|
||||||
add(dashboardItem)
|
if (!isNotLoadedAdminMessage) add(dashboardItem)
|
||||||
}
|
}
|
||||||
|
|
||||||
val isRefreshItemLoaded =
|
val isRefreshItemLoaded =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user