|
@@ -67,6 +67,7 @@ import eu.kanade.tachiyomi.ui.reader.viewer.ReaderProgressIndicator
|
|
|
import eu.kanade.tachiyomi.ui.reader.viewer.pager.R2LPagerViewer
|
|
|
import eu.kanade.tachiyomi.ui.webview.WebViewActivity
|
|
|
import eu.kanade.tachiyomi.util.Constants
|
|
|
+import eu.kanade.tachiyomi.util.lang.launchIO
|
|
|
import eu.kanade.tachiyomi.util.lang.launchNonCancellable
|
|
|
import eu.kanade.tachiyomi.util.lang.withUIContext
|
|
|
import eu.kanade.tachiyomi.util.preference.toggle
|
|
@@ -716,10 +717,12 @@ class ReaderActivity : BaseActivity() {
|
|
|
private fun openChapterInWebview() {
|
|
|
val manga = viewModel.manga ?: return
|
|
|
val source = viewModel.getSource() ?: return
|
|
|
- val url = viewModel.getChapterUrl() ?: return
|
|
|
-
|
|
|
- val intent = WebViewActivity.newIntent(this, url, source.id, manga.title)
|
|
|
- startActivity(intent)
|
|
|
+ lifecycleScope.launchIO {
|
|
|
+ viewModel.getChapterUrl()?.let { url ->
|
|
|
+ val intent = WebViewActivity.newIntent(this@ReaderActivity, url, source.id, manga.title)
|
|
|
+ withUIContext { startActivity(intent) }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
private fun showReadingModeToast(mode: Int) {
|