fix regression in web clients

This commit is contained in:
John O'Reilly 2021-07-19 21:34:51 +01:00
parent b0353d56d0
commit de5b1893ad
3 changed files with 6 additions and 3 deletions

View file

@ -17,6 +17,7 @@ import kotlin.coroutines.CoroutineContext
interface PeopleInSpaceRepositoryInterface {
fun fetchPeopleAsFlow(): Flow<List<Assignment>>
fun pollISSPosition(): Flow<IssPosition>
suspend fun fetchPeople(): List<Assignment>
}
class PeopleInSpaceRepository : KoinComponent, PeopleInSpaceRepositoryInterface {
@ -61,7 +62,7 @@ class PeopleInSpaceRepository : KoinComponent, PeopleInSpaceRepositoryInterface
}
// Used by web client atm
suspend fun fetchPeople() = peopleInSpaceApi.fetchPeople().people
override suspend fun fetchPeople() = peopleInSpaceApi.fetchPeople().people
// called from Kotlin/Native clients
fun startObservingPeopleUpdates(success: (List<Assignment>) -> Unit) {

View file

@ -3,6 +3,7 @@ import com.surrus.common.di.initKoin
import com.surrus.common.remote.Assignment
import com.surrus.common.remote.IssPosition
import com.surrus.common.repository.PeopleInSpaceRepository
import com.surrus.common.repository.PeopleInSpaceRepositoryInterface
import kotlinx.coroutines.InternalCoroutinesApi
import kotlinx.coroutines.flow.collect
import org.jetbrains.compose.common.foundation.layout.Column
@ -14,7 +15,7 @@ private val koin = initKoin(enableNetworkLogs = true).koin
@InternalCoroutinesApi
fun main() {
val repo = koin.get<PeopleInSpaceRepository>()
val repo = koin.get<PeopleInSpaceRepositoryInterface>()
renderComposable(rootElementId = "root") {
Style(TextStyles)

View file

@ -1,6 +1,7 @@
import co.touchlab.kermit.Kermit
import com.surrus.common.di.initKoin
import com.surrus.common.repository.PeopleInSpaceRepository
import com.surrus.common.repository.PeopleInSpaceRepositoryInterface
import kotlinx.coroutines.InternalCoroutinesApi
import org.koin.core.component.KoinComponent
import org.koin.core.component.get
@ -9,7 +10,7 @@ import react.createContext
import react.dom.render
object AppDependencies : KoinComponent {
val repository: PeopleInSpaceRepository
val repository: PeopleInSpaceRepositoryInterface
val logger: Kermit
init {