Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jobobby04 committed Jan 22, 2025
1 parent 456db52 commit 2b890c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.flow.catch
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.flow.launchIn
import kotlinx.coroutines.flow.onEach
import kotlinx.coroutines.flow.receiveAsFlow
Expand Down Expand Up @@ -77,6 +78,7 @@ open class FeedScreenModel(
getFeedSavedSearchGlobal.subscribe()
.distinctUntilChanged()
.onEach {
sourceManager.isInitialized.first { it }
val items = getSourcesToGetFeed(it).map { (feed, savedSearch) ->
createCatalogueSearchItem(
feed = feed,
Expand Down
4 changes: 4 additions & 0 deletions app/src/main/java/exh/md/MangaDexLoginActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ import android.net.Uri
import androidx.lifecycle.lifecycleScope
import eu.kanade.tachiyomi.ui.setting.track.BaseOAuthLoginActivity
import exh.md.utils.MdUtil
import kotlinx.coroutines.flow.first
import tachiyomi.core.common.util.lang.launchIO
import tachiyomi.domain.source.service.SourceManager
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get

Expand All @@ -14,11 +16,13 @@ class MangaDexLoginActivity : BaseOAuthLoginActivity() {
val code = data?.getQueryParameter("code")
if (code != null) {
lifecycleScope.launchIO {
Injekt.get<SourceManager>().isInitialized.first { it }
MdUtil.getEnabledMangaDex(Injekt.get())?.login(code)
returnToSettings()
}
} else {
lifecycleScope.launchIO {
Injekt.get<SourceManager>().isInitialized.first { it }
MdUtil.getEnabledMangaDex(Injekt.get())?.logout()
returnToSettings()
}
Expand Down

0 comments on commit 2b890c2

Please sign in to comment.