Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitda4f2ec

Browse files
committed
fix: don't show twice the connection to the same workspace
Connections started with two different hostnames (because of the ssh wildcard config)can be rendered twice in the Recent projects panel.With this commit we ignore the hostname and instead use the workspace name and deployment URL.
1 parentacc3eba commitda4f2ec

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

‎src/main/kotlin/com/coder/gateway/models/RecentWorkspaceConnection.kt‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ class RecentWorkspaceConnection(
8282

8383
otherasRecentWorkspaceConnection
8484

85-
if (coderWorkspaceHostname!= other.coderWorkspaceHostname)returnfalse
85+
if (name!= other.name)returnfalse
86+
if (deploymentURL!= other.deploymentURL)returnfalse
8687
if (projectPath!= other.projectPath)returnfalse
8788
if (ideProductCode!= other.ideProductCode)returnfalse
8889
if (ideBuildNumber!= other.ideBuildNumber)returnfalse
@@ -92,7 +93,8 @@ class RecentWorkspaceConnection(
9293

9394
overridefunhashCode():Int {
9495
var result=super.hashCode()
95-
result=31* result+ (coderWorkspaceHostname?.hashCode()?:0)
96+
result=31* result+ (name?.hashCode()?:0)
97+
result=31* result+ (deploymentURL?.hashCode()?:0)
9698
result=31* result+ (projectPath?.hashCode()?:0)
9799
result=31* result+ (ideProductCode?.hashCode()?:0)
98100
result=31* result+ (ideBuildNumber?.hashCode()?:0)
@@ -101,18 +103,21 @@ class RecentWorkspaceConnection(
101103
}
102104

103105
overridefuncompareTo(other:RecentWorkspaceConnection):Int {
104-
val i= other.coderWorkspaceHostname?.let {coderWorkspaceHostname?.compareTo(it) }
106+
val i= other.name?.let {name?.compareTo(it) }
105107
if (i!=null&& i!=0)return i
106108

107-
val j= other.projectPath?.let {projectPath?.compareTo(it) }
109+
val j= other.deploymentURL?.let {deploymentURL?.compareTo(it) }
108110
if (j!=null&& j!=0)return j
109111

110-
val k= other.ideProductCode?.let {ideProductCode?.compareTo(it) }
112+
val k= other.projectPath?.let {projectPath?.compareTo(it) }
111113
if (k!=null&& k!=0)return k
112114

113-
val l= other.ideBuildNumber?.let {ideBuildNumber?.compareTo(it) }
115+
val l= other.ideProductCode?.let {ideProductCode?.compareTo(it) }
114116
if (l!=null&& l!=0)return l
115117

118+
val m= other.ideBuildNumber?.let { ideBuildNumber?.compareTo(it) }
119+
if (m!=null&& m!=0)return m
120+
116121
return0
117122
}
118123
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp