Manhua no longer switches to LTR reader if the default reader is webtoon

This commit is contained in:
Jay 2020-04-26 19:11:00 -04:00
parent 610569cbc3
commit caaddda040

View File

@ -414,14 +414,16 @@ class ReaderPresenter(
* Returns the viewer position used by this manga or the default one. * Returns the viewer position used by this manga or the default one.
*/ */
fun getMangaViewer(): Int { fun getMangaViewer(): Int {
val manga = manga ?: return preferences.defaultViewer() val default = preferences.defaultViewer()
val manga = manga ?: return default
val readerType = manga.defaultReaderType() val readerType = manga.defaultReaderType()
if (manga.viewer == -1 || if (manga.viewer == -1 || (readerType == ReaderActivity.WEBTOON && readerType != manga.viewer)) {
(readerType == ReaderActivity.WEBTOON && readerType != manga.viewer)) { val cantSwitchToLTR =
manga.viewer = readerType (readerType == ReaderActivity.LEFT_TO_RIGHT && default != ReaderActivity.RIGHT_TO_LEFT)
manga.viewer = if (cantSwitchToLTR) 0 else readerType
db.updateMangaViewer(manga).asRxObservable().subscribe() db.updateMangaViewer(manga).asRxObservable().subscribe()
} }
return if (manga.viewer == 0) preferences.defaultViewer() else manga.viewer return if (manga.viewer == 0) default else manga.viewer
} }
/** /**