fix(merged-chapters) Fix chapter's webview (#1116)

* Fix chapter's webview

* combine null check

* variable name

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>

---------

Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
Cuong-Tran 2025-08-29 18:10:55 +07:00 committed by GitHub
parent 8cfab79227
commit d385dfe808
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -830,7 +830,13 @@ class ReaderViewModel @JvmOverloads constructor(
fun getChapterUrl(): String? {
val sChapter = getCurrentChapter()?.chapter ?: return null
val source = getSource() ?: return null
val source = if (manga?.source == MERGED_SOURCE_ID) {
state.value.mergedManga?.get(sChapter.manga_id)?.source?.let { sourceId ->
sourceManager.getOrStub(sourceId) as? HttpSource
}
} else {
getSource()
} ?: return null
return try {
source.getChapterUrl(sChapter)