From c8b2fadbb000c1d50eb926e2ce9946ffe2465ff4 Mon Sep 17 00:00:00 2001 From: Azpect3120 <104033825+Azpect3120@users.noreply.github.com> Date: Mon, 19 Aug 2024 14:27:28 -0700 Subject: [PATCH] FIX: The connection list is now displayed sorted. Current on top. --- internal/templates/connections.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/templates/connections.go b/internal/templates/connections.go index b185372..b37df6c 100644 --- a/internal/templates/connections.go +++ b/internal/templates/connections.go @@ -19,11 +19,12 @@ func ConnectionsList(connections map[string]string, current string) string { return html + LIST_CLOSE } - for name, url := range connections { + html += fmt.Sprintf(LIST_ITEM, connections[current], " selected", current) + for _, name := range getSortedKeys(connections) { if name == current { - html += fmt.Sprintf(LIST_ITEM, url, " selected", name) + continue } else { - html += fmt.Sprintf(LIST_ITEM, url, "", name) + html += fmt.Sprintf(LIST_ITEM, connections[name], "", name) } }