[gitlab/github] Resolve warnings about early updating toolbar

Toolbar was deterministically updated before adding it to the component tree.
`launch` is more likely to delay that update, though I guess it may not be 100%.

GitOrigin-RevId: 912684ffff5ade602b3b0448bdbd25a304426b23
This commit is contained in:
Chris Lemaire
2024-09-30 18:38:47 +02:00
committed by intellij-monorepo-bot
parent 0d2f04cbb0
commit a28c8ee586
2 changed files with 3 additions and 2 deletions

View File

@@ -235,7 +235,7 @@ internal object GHPRCreateComponentFactory {
}
// Force an action's update with every new value for commits and template
cs.launchNow {
cs.launch {
vm.titleAndDescriptionGenerationVm.collect {
if (it == null) {
toolbar.updateActionsAsync()

View File

@@ -22,6 +22,7 @@ import git4idea.ui.branch.MergeDirectionModel
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.flow.filterNotNull
import kotlinx.coroutines.flow.map
import kotlinx.coroutines.launch
import org.jetbrains.plugins.gitlab.mergerequest.ui.create.model.*
import org.jetbrains.plugins.gitlab.util.GitLabBundle
import org.jetbrains.plugins.gitlab.util.GitLabProjectMapping
@@ -107,7 +108,7 @@ internal object GitLabMergeRequestCreateComponentFactory {
}
// Force an action's update with new values for commits and generating state
launchNow {
launch {
createVm.titleGenerationVm.collect {
if (it == null) {
toolbar.updateActionsAsync()