Skip to content

Commit 89e04b0

Browse files
committed
Show each deployment error once
It was only showing the first deployment's error.
1 parent ae7d84a commit 89e04b0

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/kotlin/com/coder/gateway/views/CoderGatewayRecentWorkspaceConnectionsView.kt

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,17 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
158158
recentWorkspacesContentPanel.viewport.view =
159159
panel {
160160
connectionsByDeployment.forEach { (deploymentURL, connectionsByWorkspace) ->
161+
var first = true
161162
val deployment = deployments[deploymentURL.toString()]
162163
val deploymentError = deployment?.error
163164
connectionsByWorkspace.forEach { (workspaceName, connections) ->
165+
// Show the error at the top of each deployment list.
166+
val showError = if (first) {
167+
first = false
168+
true
169+
} else {
170+
false
171+
}
164172
val workspaceWithAgent = deployment?.items?.firstOrNull { it.workspace.name == workspaceName }
165173
val status =
166174
if (deploymentError != null) {
@@ -246,7 +254,7 @@ class CoderGatewayRecentWorkspaceConnectionsView(private val setContentCallback:
246254
},
247255
)
248256
}.topGap(gap)
249-
if (gap == TopGap.NONE) { // Show the error once at the top.
257+
if (showError) {
250258
row {
251259
// There must be a way to make this properly wrap?
252260
label("<html><body style='width:350px;'>" + status.third + "</html>").applyToComponent {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy