1
0
mirror of https://github.com/wulkanowy/wulkanowy.git synced 2025-02-20 21:44:45 +01:00

Fix infinite refresh when admin messages list is empty (#1587)

This commit is contained in:
Rafał Borcz 2021-10-14 16:25:09 +02:00 committed by GitHub
parent e7550f7a43
commit 4c8d9c8f7f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -620,6 +620,8 @@ class DashboardPresenter @Inject constructor(
if (dashboardItem is DashboardItem.AdminMessages && !dashboardItem.isDataLoaded) {
dashboardItemsToLoad = dashboardItemsToLoad - DashboardItem.Type.ADMIN_MESSAGE
dashboardTileLoadedList = dashboardTileLoadedList - DashboardItem.Tile.ADMIN_MESSAGE
dashboardItemLoadedList.removeAll { it.type == DashboardItem.Type.ADMIN_MESSAGE }
}
@ -654,9 +656,12 @@ class DashboardPresenter @Inject constructor(
}
private fun updateForceRefreshData(dashboardItem: DashboardItem) {
val isNotLoadedAdminMessage =
dashboardItem is DashboardItem.AdminMessages && !dashboardItem.isDataLoaded
with(dashboardItemRefreshLoadedList) {
removeAll { it.type == dashboardItem.type }
add(dashboardItem)
if (!isNotLoadedAdminMessage) add(dashboardItem)
}
val isRefreshItemLoaded =