Add presenter subscriptions to the subscription list when using custom subscribe methods
This commit is contained in:
@@ -49,8 +49,8 @@ class MangaPresenter : BasePresenter<MangaActivity>() {
|
||||
// Prepare a subject to communicate the chapters and info presenters for the chapter count.
|
||||
SharedData.put(ChapterCountEvent())
|
||||
|
||||
add(Observable.just(manga)
|
||||
.subscribeLatestCache({ view, manga -> view.onSetManga(manga) }))
|
||||
Observable.just(manga)
|
||||
.subscribeLatestCache({ view, manga -> view.onSetManga(manga) })
|
||||
}
|
||||
|
||||
override fun onDestroy() {
|
||||
|
||||
@@ -69,8 +69,8 @@ class ChaptersPresenter : BasePresenter<ChaptersFragment>() {
|
||||
{ view, error -> Timber.e(error.cause, error.message) })
|
||||
|
||||
manga = SharedData.get(MangaEvent::class.java)?.manga ?: return
|
||||
add(Observable.just(manga)
|
||||
.subscribeLatestCache({ view, manga -> view.onNextManga(manga) }))
|
||||
Observable.just(manga)
|
||||
.subscribeLatestCache({ view, manga -> view.onNextManga(manga) })
|
||||
|
||||
source = sourceManager.get(manga.source)!!
|
||||
start(DB_CHAPTERS)
|
||||
|
||||
@@ -79,9 +79,9 @@ class MangaInfoPresenter : BasePresenter<MangaInfoFragment>() {
|
||||
|
||||
// Update chapter count
|
||||
SharedData.get(ChapterCountEvent::class.java)?.let {
|
||||
add(it.observable
|
||||
it.observable
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribeLatestCache({ view, count -> view.setChapterCount(count) }))
|
||||
.subscribeLatestCache({ view, count -> view.setChapterCount(count) })
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user