File tree Expand file tree Collapse file tree
app/src/main/kotlin/me/nanova/summaryexpressive/data/repository Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package me.nanova.summaryexpressive.data.repository
22
33import kotlinx.coroutines.flow.Flow
4+ import kotlinx.coroutines.flow.emptyFlow
45import kotlinx.coroutines.flow.map
56import me.nanova.summaryexpressive.data.AIProviderConfigDao
67import me.nanova.summaryexpressive.data.AIProviderConfigEntity
@@ -15,11 +16,11 @@ open class AIProviderConfigRepository @Inject constructor(
1516 open val providerConfigsFlow: Flow <Map <String , ProviderConfig >>
1617 get() = aiProviderConfigDao?.getAllConfigsFlow()?.map { entities ->
1718 entities.associate { it.provider to it.toProviderConfig() }
18- } ? : kotlinx.coroutines.flow. emptyFlow()
19+ } ? : emptyFlow()
1920
2021 open fun getConfigFlow (provider : String ): Flow <ProviderConfig ?> =
2122 aiProviderConfigDao?.getConfigFlow(provider)?.map { it?.toProviderConfig() }
22- ? : kotlinx.coroutines.flow. emptyFlow()
23+ ? : emptyFlow()
2324
2425 open suspend fun getConfig (provider : String ): ProviderConfig ? =
2526 aiProviderConfigDao?.getConfig(provider)?.toProviderConfig()
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import android.content.Context
44import dagger.hilt.android.qualifiers.ApplicationContext
55import kotlinx.coroutines.flow.Flow
66import kotlinx.coroutines.flow.catch
7+ import kotlinx.coroutines.flow.emptyFlow
78import me.nanova.summaryexpressive.data.local.datastore.userPreferencesDataStore
89import me.nanova.summaryexpressive.model.UserPreferences
910import java.io.IOException
@@ -21,7 +22,7 @@ open class UserPreferencesRepository @Inject constructor(
2122 } else {
2223 throw exception
2324 }
24- } ? : kotlinx.coroutines.flow. emptyFlow()
25+ } ? : emptyFlow()
2526
2627 private suspend fun updatePreferences (transform : suspend (UserPreferences ) -> UserPreferences ) {
2728 context?.userPreferencesDataStore?.updateData { transform(it) }
You can’t perform that action at this time.
0 commit comments