mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-14 16:45:06 +01:00
Fix a few more endless loading issues
This commit is contained in:
parent
40a9b2c421
commit
212386f3cc
@ -312,7 +312,7 @@ class RecentsController(bundle: Bundle? = null) :
|
|||||||
if (!hasNewItems || presenter.viewType == RecentsPresenter.VIEW_TYPE_GROUP_ALL || presenter.query.isNotEmpty() ||
|
if (!hasNewItems || presenter.viewType == RecentsPresenter.VIEW_TYPE_GROUP_ALL || presenter.query.isNotEmpty() ||
|
||||||
recents.isEmpty()
|
recents.isEmpty()
|
||||||
) {
|
) {
|
||||||
onAddPageError()
|
loadNoMore()
|
||||||
} else if (hasNewItems && presenter.viewType != RecentsPresenter.VIEW_TYPE_GROUP_ALL && presenter.query.isEmpty()) {
|
} else if (hasNewItems && presenter.viewType != RecentsPresenter.VIEW_TYPE_GROUP_ALL && presenter.query.isEmpty()) {
|
||||||
resetProgressItem()
|
resetProgressItem()
|
||||||
}
|
}
|
||||||
@ -477,7 +477,7 @@ class RecentsController(bundle: Bundle? = null) :
|
|||||||
setOnQueryTextChangeListener(searchView) {
|
setOnQueryTextChangeListener(searchView) {
|
||||||
if (presenter.query != it) {
|
if (presenter.query != it) {
|
||||||
presenter.query = it ?: return@setOnQueryTextChangeListener false
|
presenter.query = it ?: return@setOnQueryTextChangeListener false
|
||||||
onAddPageError()
|
loadNoMore()
|
||||||
refresh()
|
refresh()
|
||||||
}
|
}
|
||||||
true
|
true
|
||||||
@ -544,14 +544,18 @@ class RecentsController(bundle: Bundle? = null) :
|
|||||||
|
|
||||||
override fun onLoadMore(lastPosition: Int, currentPage: Int) {
|
override fun onLoadMore(lastPosition: Int, currentPage: Int) {
|
||||||
val view = view ?: return
|
val view = view ?: return
|
||||||
if (presenter.finished || BackupRestoreService.isRunning(view.context.applicationContext)) {
|
if (presenter.finished ||
|
||||||
onAddPageError()
|
BackupRestoreService.isRunning(view.context.applicationContext) ||
|
||||||
|
presenter.viewType == RecentsPresenter.VIEW_TYPE_GROUP_ALL ||
|
||||||
|
presenter.query.isNotEmpty()
|
||||||
|
) {
|
||||||
|
loadNoMore()
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
presenter.requestNext()
|
presenter.requestNext()
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun onAddPageError() {
|
private fun loadNoMore() {
|
||||||
adapter.onLoadMoreComplete(null)
|
adapter.onLoadMoreComplete(null)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user