fix placeholder not disappearing when no statuses are loaded (#2305)

This commit is contained in:
Konrad Pozniak 2022-02-02 18:29:59 +01:00 committed by GitHub
parent 8f5fb5b35c
commit ab6ea6dc89
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -162,13 +162,13 @@ class CachedTimelineViewModel @Inject constructor(
) )
} }
if (overlappedStatuses == 0) { if (overlappedStatuses == 0 && statuses.isNotEmpty()) {
timelineDao.insertStatus( timelineDao.insertStatus(
Placeholder(statuses.last().id.dec(), loading = false).toEntity(activeAccount.id) Placeholder(statuses.last().id.dec(), loading = false).toEntity(activeAccount.id)
) )
} }
} }
} catch (e: java.lang.Exception) { } catch (e: Exception) {
loadMoreFailed(placeholderId, e) loadMoreFailed(placeholderId, e)
} }
} }