From 3611f67fb490815405c41e229c991b2b4a720a48 Mon Sep 17 00:00:00 2001 From: FlaminSarge Date: Fri, 21 Sep 2018 00:51:37 -0700 Subject: [PATCH] Handle manga info fetch errors in the same way as chapter fetch errors (#1541) (Using a toast) --- .../eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt | 3 ++- .../eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt | 4 +--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt index 439ebabb01..cb9b091faf 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoController.kt @@ -355,8 +355,9 @@ class MangaInfoController : NucleusController(), /** * Update swipe refresh to start showing refresh in progress spinner. */ - fun onFetchMangaError() { + fun onFetchMangaError(error: Throwable) { setRefreshing(false) + activity?.toast(error.message) } /** diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt index 9064c08a0a..5083498cea 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/info/MangaInfoPresenter.kt @@ -90,9 +90,7 @@ class MangaInfoPresenter( .doOnNext { sendMangaToView() } .subscribeFirst({ view, _ -> view.onFetchMangaDone() - }, { view, _ -> - view.onFetchMangaError() - }) + }, MangaInfoController::onFetchMangaError) } /**