Skip to content

Commit 98398f9

Browse files
committed
fix race condition in Environment name text field
1 parent 2461392 commit 98398f9

File tree

1 file changed

+1
-1
lines changed
  • src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux

1 file changed

+1
-1
lines changed

src/jvmMain/kotlin/com/sunnychung/application/multiplatform/hellohttp/ux/AppView.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ fun AppContentView() {
171171
val coroutineScope = rememberCoroutineScope()
172172
var selectedProject by remember { mutableStateOf<Project?>(null) }
173173
var selectedSubprojectId by remember { mutableStateOf<String?>(null) }
174-
val selectedSubproject = selectedSubprojectId?.let { projectCollectionRepository.subscribeLatestSubproject(ProjectAndEnvironmentsDI(), it).collectAsState(null).value?.first }
174+
val selectedSubproject = selectedSubprojectId?.let { projectCollectionRepository.subscribeLatestSubproject(ProjectAndEnvironmentsDI(), it).collectAsState(null, Dispatchers.Main.immediate).value?.first }
175175
var selectedEnvironment by remember { mutableStateOf<Environment?>(null) }
176176
var requestCollectionDI by remember { mutableStateOf<RequestsDI?>(null) }
177177
val requestCollection = requestCollectionDI?.let { di -> requestCollectionRepository.subscribeLatestCollection(di).collectAsState(null).value?.first }

0 commit comments

Comments
 (0)