Skip to content

Commit 7deb5dc

Browse files
#1894063: UI blocks if user can not access github when open sdk reference book
1 parent 0e3a907 commit 7deb5dc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/referencebook/AzureSdkReferenceBookPanel.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
package com.microsoft.azure.toolkit.intellij.azuresdk.referencebook;
77

88
import com.intellij.ui.components.JBScrollPane;
9+
import com.microsoft.azure.toolkit.lib.common.bundle.AzureString;
10+
import com.microsoft.azure.toolkit.lib.common.task.AzureTaskManager;
911
import lombok.Getter;
1012

1113
import javax.swing.*;
@@ -22,7 +24,7 @@ public class AzureSdkReferenceBookPanel {
2224
public AzureSdkReferenceBookPanel() {
2325
this.contentPanel.setPreferredSize(new Dimension(840, 600));
2426
this.initListeners();
25-
this.servicesTreePanel.refresh();
27+
AzureTaskManager.getInstance().runInBackground(AzureString.fromString("loading Azure SDK data"), () -> this.servicesTreePanel.refresh());
2628
}
2729

2830
private void initListeners() {

PluginsAndFeatures/azure-toolkit-for-intellij/azure-sdk-reference-book/src/main/java/com/microsoft/azure/toolkit/intellij/azuresdk/referencebook/AzureSdkTreePanel.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public void refresh(boolean... force) {
111111
this.categories = AzureSdkCategoryService.loadAzureSDKCategories();
112112
this.fillDescriptionFromCategoryIfMissing(this.categories, this.services);
113113
this.filter.debounce();
114-
Optional.ofNullable(this.lastNodePath).ifPresent(p -> TreeUtil.selectPath(this.tree, p));
114+
AzureTaskManager.getInstance().runLater(() -> Optional.ofNullable(this.lastNodePath).ifPresent(p -> TreeUtil.selectPath(this.tree, p)));
115115
} catch (final IOException e) {
116116
//TODO: messager.warning(...)
117117
e.printStackTrace();

0 commit comments

Comments
 (0)