mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-10 20:57:24 +01:00
MangaPresenter: Incognito and downloaded only label related tweaks (#7535)
When manga screen takes time to load incognito and downloaded only label doesn't show up. It's fixed in the pr.
This commit is contained in:
parent
9ebeff04e6
commit
b034f503f8
@ -147,6 +147,17 @@ class MangaPresenter(
|
|||||||
_state.update { if (it is MangaScreenState.Success) func(it) else it }
|
_state.update { if (it is MangaScreenState.Success) func(it) else it }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private var incognitoMode = false
|
||||||
|
set(value) {
|
||||||
|
updateSuccessState { it.copy(isIncognitoMode = value) }
|
||||||
|
field = value
|
||||||
|
}
|
||||||
|
private var downloadedOnlyMode = false
|
||||||
|
set(value) {
|
||||||
|
updateSuccessState { it.copy(isDownloadedOnlyMode = value) }
|
||||||
|
field = value
|
||||||
|
}
|
||||||
|
|
||||||
override fun onCreate(savedState: Bundle?) {
|
override fun onCreate(savedState: Bundle?) {
|
||||||
super.onCreate(savedState)
|
super.onCreate(savedState)
|
||||||
|
|
||||||
@ -174,6 +185,8 @@ class MangaPresenter(
|
|||||||
isFromSource = isFromSource,
|
isFromSource = isFromSource,
|
||||||
trackingAvailable = trackManager.hasLoggedServices(),
|
trackingAvailable = trackManager.hasLoggedServices(),
|
||||||
chapters = chapterItems,
|
chapters = chapterItems,
|
||||||
|
isIncognitoMode = incognitoMode,
|
||||||
|
isDownloadedOnlyMode = downloadedOnlyMode
|
||||||
)
|
)
|
||||||
|
|
||||||
// Update state
|
// Update state
|
||||||
@ -195,13 +208,13 @@ class MangaPresenter(
|
|||||||
|
|
||||||
preferences.incognitoMode()
|
preferences.incognitoMode()
|
||||||
.asImmediateFlow { incognito ->
|
.asImmediateFlow { incognito ->
|
||||||
updateSuccessState { it.copy(isIncognitoMode = incognito) }
|
incognitoMode = incognito
|
||||||
}
|
}
|
||||||
.launchIn(presenterScope)
|
.launchIn(presenterScope)
|
||||||
|
|
||||||
preferences.downloadedOnly()
|
preferences.downloadedOnly()
|
||||||
.asImmediateFlow { downloadedOnly ->
|
.asImmediateFlow { downloadedOnly ->
|
||||||
updateSuccessState { it.copy(isDownloadedOnlyMode = downloadedOnly) }
|
downloadedOnlyMode = downloadedOnly
|
||||||
}
|
}
|
||||||
.launchIn(presenterScope)
|
.launchIn(presenterScope)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user