mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[github] Fix changes loading panel selection
GitOrigin-RevId: df24ea1324de3b5e3864ad7346695346c9a74b38
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e310ef23f2
commit
69dac70e6b
+7
-9
@@ -1,10 +1,9 @@
|
||||
// Copyright 2000-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
// Copyright 2000-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file.
|
||||
package org.jetbrains.plugins.github.pullrequest.ui.changes
|
||||
|
||||
import org.jetbrains.plugins.github.pullrequest.data.GHPRDataProvider
|
||||
import org.jetbrains.plugins.github.pullrequest.ui.GHEventDispatcherLoadingModel
|
||||
import org.jetbrains.plugins.github.util.handleOnEdt
|
||||
import org.jetbrains.plugins.github.util.successOnEdt
|
||||
import java.util.concurrent.CompletableFuture
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
@@ -57,15 +56,14 @@ class GHPRChangesLoadingModel(private val changesModel: GHPRChangesModel,
|
||||
loading = true
|
||||
error = null
|
||||
|
||||
updateFuture = dataProvider.changesProviderRequest.successOnEdt {
|
||||
updateFuture = dataProvider.changesProviderRequest.handleOnEdt { result, error ->
|
||||
|
||||
if (zipChanges) changesModel.changes = it.changes
|
||||
else changesModel.commits = it.changesByCommits
|
||||
|
||||
diffHelper.setUp(dataProvider, it)
|
||||
|
||||
}.handleOnEdt { _, error: Throwable? ->
|
||||
if (result != null) {
|
||||
if (zipChanges) changesModel.changes = result.changes
|
||||
else changesModel.commits = result.changesByCommits
|
||||
|
||||
diffHelper.setUp(dataProvider, result)
|
||||
}
|
||||
if (error != null) this.error = error
|
||||
loading = false
|
||||
eventDispatcher.multicaster.onLoadingCompleted()
|
||||
|
||||
Reference in New Issue
Block a user