mirror of
https://github.com/smyalygames/checklist-tester.git
synced 2025-05-18 14:34:12 +02:00
refactor(connector): remove redundant artificial load delay
This commit is contained in:
parent
6cb8f46594
commit
87e97701ca
@ -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) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user