[gl] fix combine not getting collected in create VM (IJPL-216984)

#IJPL-216984 Fixed

GitOrigin-RevId: eb1ad54644fc7b283b1d7967f37211b6af574cf5
This commit is contained in:
Chris Lemaire
2025-11-06 08:39:56 +00:00
committed by intellij-monorepo-bot
parent e9223f6377
commit b525564635
@@ -197,13 +197,13 @@ internal class GitLabMergeRequestCreateViewModelImpl(
}
cs.launch {
combine(commits, branchState) { commitsResult, branchState ->
combineAndCollect(commits, branchState) { commitsResult, branchState ->
val commits = commitsResult?.getOrNull()
if (commits != null && commits.size == 1 && titleText.value.isEmpty()) {
setTitle(commits.first().subject.lines().firstOrNull() ?: return@combine)
setTitle(commits.first().subject.lines().firstOrNull() ?: return@combineAndCollect)
}
else if (titleText.value.isEmpty()) {
setTitle(when (val branch = branchState?.headBranch ?: return@combine) {
setTitle(when (val branch = branchState?.headBranch ?: return@combineAndCollect) {
is GitRemoteBranch -> branch.nameForRemoteOperations
else -> branch.name
})