fix: show a server's host instead of repeating its address
A connection saved without a name (including the one migrated from the single-server record) showed its URL as both title and subtitle. Fall back to the host, and migrate old records that stored the URL as the name.
This commit is contained in:
1 parent
13aca21d99
commit
265145af41
4 files changed
+28
-7
No files matched your search
@@ -331,10 +331,14 @@ func (c *controller) saveConnection(conn storage.Connection) {
|
||||
}
|
||||
|
||||
func (c *controller) labelOf(conn storage.Connection) string {
|
||||
if strings.TrimSpace(conn.Label) != "" {
|
||||
return conn.Label
|
||||
label := strings.TrimSpace(conn.Label)
|
||||
if label != "" && label != conn.URL {
|
||||
return label
|
||||
}
|
||||
return hostOf(conn.URL)
|
||||
if host := hostOf(conn.URL); host != "" {
|
||||
return host
|
||||
}
|
||||
return label
|
||||
}
|
||||
|
||||
func (c *controller) refresh() {
|
||||
|
||||
Reference in new issue
Block a user