refactor(connector): remove redundant artificial load delay

This commit is contained in:
Anthony 2024-04-04 10:16:28 +02:00
parent 6cb8f46594
commit 87e97701ca

View File

@ -4,17 +4,12 @@ import cafe.adriel.voyager.core.model.StateScreenModel
import cafe.adriel.voyager.core.model.screenModelScope
import io.anthonyberg.connector.shared.ProjectTransaction
import io.anthonyberg.connector.shared.entity.Project
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
class ProjectsScreenModel (
private val db: ProjectTransaction
) : StateScreenModel<ProjectsScreenModel.State>(State.UnInit) {
override fun onDispose() {
println("Project Disposed")
}
sealed class State {
object UnInit : State()
object Init : State()
@ -25,7 +20,6 @@ class ProjectsScreenModel (
fun projectExists() {
screenModelScope.launch {
mutableState.value = State.Loading
delay(5000)
val exists = db.projectExists()
if (exists) {