mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[github] Fix viewed/not viewed markers not showing for single commit PR
GitOrigin-RevId: 489609ebf44f56d0ecd67c1e247b524a182faad6
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5afb1d7926
commit
b6ee242c14
+4
-6
@@ -2,10 +2,7 @@
|
||||
package org.jetbrains.plugins.github.pullrequest.ui.details.model
|
||||
|
||||
import com.intellij.collaboration.async.values
|
||||
import com.intellij.collaboration.ui.codereview.details.model.CodeReviewChangeDetails
|
||||
import com.intellij.collaboration.ui.codereview.details.model.CodeReviewChangeList
|
||||
import com.intellij.collaboration.ui.codereview.details.model.CodeReviewChangeListViewModel
|
||||
import com.intellij.collaboration.ui.codereview.details.model.CodeReviewChangeListViewModelBase
|
||||
import com.intellij.collaboration.ui.codereview.details.model.*
|
||||
import com.intellij.collaboration.util.RefComparisonChange
|
||||
import com.intellij.collaboration.util.filePath
|
||||
import com.intellij.openapi.actionSystem.DataKey
|
||||
@@ -40,6 +37,7 @@ internal class GHPRChangeListViewModelImpl(
|
||||
override val project: Project,
|
||||
private val dataContext: GHPRDataContext,
|
||||
private val dataProvider: GHPRDataProvider,
|
||||
changes: CodeReviewChangesContainer,
|
||||
changeList: CodeReviewChangeList
|
||||
) : GHPRChangeListViewModel, CodeReviewChangeListViewModelBase(parentCs, changeList) {
|
||||
private val repository: GitRepository get() = dataContext.repositoryDataService.remoteCoordinates.repository
|
||||
@@ -47,12 +45,12 @@ internal class GHPRChangeListViewModelImpl(
|
||||
private val _isUpdating = MutableStateFlow(false)
|
||||
override val isUpdating: StateFlow<Boolean> = _isUpdating.asStateFlow()
|
||||
|
||||
override val isOnLatest: Boolean = changeList.commitSha == null
|
||||
override val isOnLatest: Boolean = changeList.commitSha == null || changes.commits.size == 1
|
||||
|
||||
private val viewedStateData = dataProvider.viewedStateData
|
||||
|
||||
override val detailsByChange: StateFlow<Map<RefComparisonChange, CodeReviewChangeDetails>> =
|
||||
if (changeList.commitSha == null) {
|
||||
if (isOnLatest) {
|
||||
createDetailsByChangeFlow().stateIn(cs, SharingStarted.Eagerly, emptyMap())
|
||||
}
|
||||
else {
|
||||
|
||||
+2
-2
@@ -101,8 +101,8 @@ internal class GHPRChangesViewModelImpl(
|
||||
}
|
||||
}
|
||||
|
||||
private val delegate = CodeReviewChangesViewModelDelegate(cs, changesContainer) { changeList ->
|
||||
GHPRChangeListViewModelImpl(this, project, dataContext, dataProvider, changeList).also { vm ->
|
||||
private val delegate = CodeReviewChangesViewModelDelegate(cs, changesContainer) { changes, changeList ->
|
||||
GHPRChangeListViewModelImpl(this, project, dataContext, dataProvider, changes, changeList).also { vm ->
|
||||
launch {
|
||||
isUpdatingChanges.collect {
|
||||
vm.setUpdating(it)
|
||||
|
||||
Reference in New Issue
Block a user