mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix(manga/details): NPE on tablets
This commit is contained in:
parent
515a96e649
commit
d48b4c330a
2 changed files with 19 additions and 21 deletions
12
CHANGELOG.md
12
CHANGELOG.md
|
@ -10,14 +10,4 @@
|
|||
## Other ?? Technical stuff, what happened behind the scene
|
||||
-->
|
||||
## Fixes
|
||||
- Fixed crashes caused by certain extension implementation
|
||||
- Fixed "Theme buttons based on cover" doesn't work properly
|
||||
- Fixed library cover images looks blurry then become sharp after going to
|
||||
entry's detail screen
|
||||
|
||||
## Other
|
||||
- More StorIO to SQLDelight migration effort
|
||||
- Update dependency dev.chrisbanes.compose:compose-bom to v2024.08.00-alpha02
|
||||
- Update kotlin monorepo to v2.0.20
|
||||
- Update aboutlibraries to v11.2.3
|
||||
- Remove dependency com.github.leandroBorgesFerreira:LoadingButtonAndroid
|
||||
- Fixed NPE crash on tablets
|
||||
|
|
|
@ -147,6 +147,19 @@ class MangaDetailsPresenter(
|
|||
|
||||
val headerItem: MangaHeaderItem by lazy { MangaHeaderItem(mangaId, view?.fromCatalogue == true)}
|
||||
var tabletChapterHeaderItem: MangaHeaderItem? = null
|
||||
get() {
|
||||
when (view?.isTablet) {
|
||||
true -> if (field == null) {
|
||||
field = MangaHeaderItem(mangaId, false).apply {
|
||||
isChapterHeader = true
|
||||
}
|
||||
}
|
||||
else -> if (field != null) {
|
||||
field = null
|
||||
}
|
||||
}
|
||||
return field
|
||||
}
|
||||
private set
|
||||
|
||||
var allChapterScanlators: Set<String> = emptySet()
|
||||
|
@ -160,11 +173,6 @@ class MangaDetailsPresenter(
|
|||
|
||||
downloadManager.addListener(this)
|
||||
|
||||
LibraryUpdateJob.updateFlow
|
||||
.filter { it == mangaId }
|
||||
.onEach { onUpdateManga() }
|
||||
.launchIn(presenterScope)
|
||||
|
||||
tracks = db.getTracks(manga).executeAsBlocking()
|
||||
}
|
||||
|
||||
|
@ -174,6 +182,11 @@ class MangaDetailsPresenter(
|
|||
fun onCreateLate() {
|
||||
val controller = view ?: return
|
||||
|
||||
LibraryUpdateJob.updateFlow
|
||||
.filter { it == mangaId }
|
||||
.onEach { onUpdateManga() }
|
||||
.launchIn(presenterScope)
|
||||
|
||||
if (manga.isLocal()) {
|
||||
refreshAll()
|
||||
} else if (!manga.initialized) {
|
||||
|
@ -220,11 +233,6 @@ class MangaDetailsPresenter(
|
|||
isTablet = view?.isTablet == true
|
||||
isLocked = isLockedFromSearch
|
||||
}
|
||||
if (view?.isTablet == true) {
|
||||
tabletChapterHeaderItem = MangaHeaderItem(mangaId, false).apply {
|
||||
isChapterHeader = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun getChaptersNow(): List<ChapterItem> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue