Add errors to browse + latest
This commit is contained in:
parent
1827fe0ce1
commit
fa2cde79ba
2 changed files with 19 additions and 0 deletions
|
|
@ -326,6 +326,18 @@ open class IndexController :
|
||||||
browseAdapter?.updateDataSet(browseResults)
|
browseAdapter?.updateDataSet(browseResults)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun onLatestError(e: Exception) {
|
||||||
|
e.message?.let {
|
||||||
|
binding.latestNoResultsFound.text = it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun onBrowseError(e: Exception) {
|
||||||
|
e.message?.let {
|
||||||
|
binding.browseNoResultsFound.text = it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun showLatestResultsHolder() {
|
private fun showLatestResultsHolder() {
|
||||||
binding.latestNoResultsFound.isVisible = false
|
binding.latestNoResultsFound.isVisible = false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,7 @@ import eu.kanade.tachiyomi.ui.base.presenter.BasePresenter
|
||||||
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter.Companion.toItems
|
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourcePresenter.Companion.toItems
|
||||||
import eu.kanade.tachiyomi.util.lang.awaitSingle
|
import eu.kanade.tachiyomi.util.lang.awaitSingle
|
||||||
import eu.kanade.tachiyomi.util.lang.runAsObservable
|
import eu.kanade.tachiyomi.util.lang.runAsObservable
|
||||||
|
import eu.kanade.tachiyomi.util.lang.withUIContext
|
||||||
import exh.savedsearches.EXHSavedSearch
|
import exh.savedsearches.EXHSavedSearch
|
||||||
import exh.savedsearches.JsonSavedSearch
|
import exh.savedsearches.JsonSavedSearch
|
||||||
import kotlinx.coroutines.Dispatchers
|
import kotlinx.coroutines.Dispatchers
|
||||||
|
|
@ -110,6 +111,9 @@ open class IndexPresenter(
|
||||||
.mangas
|
.mangas
|
||||||
.map { networkToLocalManga(it, source.id) }
|
.map { networkToLocalManga(it, source.id) }
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
withUIContext {
|
||||||
|
view?.onLatestError(e)
|
||||||
|
}
|
||||||
emptyList()
|
emptyList()
|
||||||
}
|
}
|
||||||
} else emptyList()
|
} else emptyList()
|
||||||
|
|
@ -127,6 +131,9 @@ open class IndexPresenter(
|
||||||
.mangas
|
.mangas
|
||||||
.map { networkToLocalManga(it, source.id) }
|
.map { networkToLocalManga(it, source.id) }
|
||||||
} catch (e: Exception) {
|
} catch (e: Exception) {
|
||||||
|
withUIContext {
|
||||||
|
view?.onBrowseError(e)
|
||||||
|
}
|
||||||
emptyList()
|
emptyList()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue