package eu.kanade.domain.source.interactor

import eu.kanade.domain.ui.UiPreferences
import eu.kanade.tachiyomi.ui.browse.source.SourcesController
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map

class GetShowLatest(
    private val preferences: UiPreferences,
) {

    fun subscribe(mode: SourcesController.Mode): Flow<Boolean> {
        return preferences.useNewSourceNavigation().changes()
            .map {
                mode == SourcesController.Mode.CATALOGUE && !it
            }
    }
}
