Fix entries not disappearing from list on swipe to dismiss
This commit is contained in:
parent
ecd3d36528
commit
22f461dabc
2 changed files with 4 additions and 4 deletions
|
@ -27,10 +27,11 @@ abstract class EntryListViewModel(
|
|||
private val _errorMessage = MutableStateFlow<String?>(null)
|
||||
val errorMessage = _errorMessage.asStateFlow()
|
||||
protected open val entryStatus: EntryStatus? = null
|
||||
private val pagingSource: EntryAndFeedPagingSource
|
||||
get() = EntryAndFeedPagingSource(entryRepository, entryStatus)
|
||||
private lateinit var pagingSource: EntryAndFeedPagingSource
|
||||
val entries = Pager(PagingConfig(pageSize = 15)) {
|
||||
pagingSource
|
||||
EntryAndFeedPagingSource(entryRepository, entryStatus).also {
|
||||
pagingSource = it
|
||||
}
|
||||
}.flow.cachedIn(viewModelScope)
|
||||
|
||||
fun dismissError() {
|
||||
|
|
|
@ -30,7 +30,6 @@ class EntryAndFeedPagingSource(
|
|||
} else {
|
||||
null
|
||||
}
|
||||
Timber.tag("Nanoflux").d("Loading data at page $nextPageNumber")
|
||||
val loadFunction = when (entryStatus) {
|
||||
EntryStatus.UNREAD -> entryRepository::loadUnread
|
||||
EntryStatus.HISTORY -> entryRepository::loadRead
|
||||
|
|
Loading…
Reference in a new issue