Skip to content

Commit 9728e5f

Browse files
AB#1993720: [Test]IDEA freezes after refreshing favorites
1 parent 0ba82ea commit 9728e5f

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

Utils/azure-toolkit-ide-libs/azure-toolkit-ide-common-lib/src/main/java/com/microsoft/azure/toolkit/ide/common/component/AzureResourceLabelView.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,9 @@ private void refreshViewInner() {
9090
final AzureTaskManager tm = AzureTaskManager.getInstance();
9191
tm.runOnPooledThread(() -> {
9292
this.icon = iconProvider.getIcon(this.resource);
93-
this.description = descriptionLoader.apply(this.resource);
94-
this.enabled = !this.resource.getFormalStatus().isDeleted();
93+
final boolean deleted = this.resource.getFormalStatus().isDeleted();
94+
this.enabled = !deleted;
95+
this.description = deleted ? AzResource.Status.DELETED : descriptionLoader.apply(this.resource);
9596
tm.runLater(this::refreshView);
9697
});
9798
}

Utils/azure-toolkit-ide-libs/azure-toolkit-ide-common-lib/src/main/java/com/microsoft/azure/toolkit/ide/common/favorite/FavoriteNodeView.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,6 @@ public String getDescription() {
4747
if (!r.getSubscription().isSelected()) {
4848
return String.format("(%s)", r.getSubscription().getName());
4949
}
50-
if (r instanceof AbstractAzResource && r.getFormalStatus().isDeleted()) {
51-
return AzResource.Status.DELETED;
52-
}
5350
return view.getDescription();
5451
}
5552

@@ -96,15 +93,6 @@ public String getIconPath() {
9693

9794
@Override
9895
public boolean isEnabled() {
99-
final AzResource<?, ?, ?> r = view.getResource();
100-
if (!Azure.az(AzureAccount.class).isLoggedIn() || !r.getSubscription().isSelected()) {
101-
return false;
102-
}
103-
if (r instanceof AbstractAzResource &&
104-
((AbstractAzResource<?, ?, ?>) r).isDraftForCreating() &&
105-
!Objects.equals(r.getStatus(), AzResource.Status.CREATING)) {
106-
return false;
107-
}
10896
return view.isEnabled();
10997
}
11098

0 commit comments

Comments
 (0)