Fix MdList isLoggedInFlow

This commit is contained in:
Cuong-Tran 2024-07-08 16:28:42 +07:00
parent 16401ea86f
commit 74a71de53e
No known key found for this signature in database
GPG key ID: 733AA7624B9315C2

View file

@ -12,6 +12,8 @@ import exh.md.network.MangaDexAuthInterceptor
import exh.md.utils.FollowStatus
import exh.md.utils.MdUtil
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import tachiyomi.core.common.util.lang.withIOContext
import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR
@ -171,6 +173,10 @@ class MdList(id: Long) : BaseTracker(id, "MDList") {
override val isLoggedIn: Boolean
get() = trackPreferences.trackToken(this).get().isNotEmpty()
override val isLoggedInFlow: Flow<Boolean> by lazy {
trackPreferences.trackToken(this).changes().map { it.isNotEmpty() }
}
class MangaDexNotFoundException : Exception("Mangadex not enabled")
// KMK -->