mirror of
https://github.com/mihonapp/mihon.git
synced 2024-12-25 02:18:24 +01:00
A few more crashes fixed
This commit is contained in:
parent
72f029b57f
commit
5fbeeade94
@ -237,8 +237,10 @@ class LibraryFragment : BaseRxFragment<LibraryPresenter>(), ActionMode.Callback
|
|||||||
this.query = query
|
this.query = query
|
||||||
|
|
||||||
// Notify the subject the query has changed.
|
// Notify the subject the query has changed.
|
||||||
|
if (isResumed) {
|
||||||
presenter.searchSubject.onNext(query)
|
presenter.searchSubject.onNext(query)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when the library is updated. It sets the new data and updates the view.
|
* Called when the library is updated. It sets the new data and updates the view.
|
||||||
|
@ -68,7 +68,7 @@ class ChaptersPresenter : BasePresenter<ChaptersFragment>() {
|
|||||||
{ view, download -> view.onChapterStatusChange(download) },
|
{ view, download -> view.onChapterStatusChange(download) },
|
||||||
{ view, error -> Timber.e(error.cause, error.message) })
|
{ view, error -> Timber.e(error.cause, error.message) })
|
||||||
|
|
||||||
manga = SharedData.get(MangaEvent::class.java)!!.manga
|
manga = SharedData.get(MangaEvent::class.java)?.manga ?: return
|
||||||
add(Observable.just(manga)
|
add(Observable.just(manga)
|
||||||
.subscribeLatestCache({ view, manga -> view.onNextManga(manga) }))
|
.subscribeLatestCache({ view, manga -> view.onNextManga(manga) }))
|
||||||
|
|
||||||
@ -79,9 +79,7 @@ class ChaptersPresenter : BasePresenter<ChaptersFragment>() {
|
|||||||
.subscribeOn(Schedulers.io())
|
.subscribeOn(Schedulers.io())
|
||||||
.doOnNext { chapters ->
|
.doOnNext { chapters ->
|
||||||
this.chapters = chapters
|
this.chapters = chapters
|
||||||
SharedData.get(ChapterCountEvent::class.java)?.let {
|
SharedData.get(ChapterCountEvent::class.java)?.emit(chapters.size)
|
||||||
it.emit(chapters.size)
|
|
||||||
}
|
|
||||||
for (chapter in chapters) {
|
for (chapter in chapters) {
|
||||||
setChapterStatus(chapter)
|
setChapterStatus(chapter)
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ class MangaInfoPresenter : BasePresenter<MangaInfoFragment>() {
|
|||||||
{ view, manga -> view.onFetchMangaDone() },
|
{ view, manga -> view.onFetchMangaDone() },
|
||||||
{ view, error -> view.onFetchMangaError() })
|
{ view, error -> view.onFetchMangaError() })
|
||||||
|
|
||||||
manga = SharedData.get(MangaEvent::class.java)!!.manga
|
manga = SharedData.get(MangaEvent::class.java)?.manga ?: return
|
||||||
source = sourceManager.get(manga.source)!!
|
source = sourceManager.get(manga.source)!!
|
||||||
refreshManga()
|
refreshManga()
|
||||||
|
|
||||||
|
@ -58,7 +58,7 @@ class MyAnimeListPresenter : BasePresenter<MyAnimeListFragment>() {
|
|||||||
{ view, result -> view.onRefreshDone() },
|
{ view, result -> view.onRefreshDone() },
|
||||||
{ view, error -> view.onRefreshError(error) })
|
{ view, error -> view.onRefreshError(error) })
|
||||||
|
|
||||||
manga = SharedData.get(MangaEvent::class.java)!!.manga
|
manga = SharedData.get(MangaEvent::class.java)?.manga ?: return
|
||||||
start(GET_MANGA_SYNC)
|
start(GET_MANGA_SYNC)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -71,7 +71,7 @@ class ReaderPresenter : BasePresenter<ReaderActivity>() {
|
|||||||
super.onCreate(savedState)
|
super.onCreate(savedState)
|
||||||
|
|
||||||
if (savedState == null) {
|
if (savedState == null) {
|
||||||
val event = SharedData.remove(ReaderEvent::class.java)!!
|
val event = SharedData.remove(ReaderEvent::class.java) ?: return
|
||||||
manga = event.manga
|
manga = event.manga
|
||||||
chapter = event.chapter
|
chapter = event.chapter
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user