From 6e4c02b1b9793776a52cf8b1f914eeadd2bbb4b5 Mon Sep 17 00:00:00 2001 From: Jeff Halter <868228+jhalter@users.noreply.github.com> Date: Mon, 20 Nov 2023 13:34:51 -0800 Subject: Fix bug in client tracker list (#106) This fixes an issue where the client would connect to the incorrect server when joining from the tracker listing. --- hotline/ui.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'hotline') diff --git a/hotline/ui.go b/hotline/ui.go index e3e2fab..c5a0dbd 100644 --- a/hotline/ui.go +++ b/hotline/ui.go @@ -113,7 +113,8 @@ func (ui *UI) getTrackerList(servers []ServerRecord) *tview.List { list.Box.SetBorder(true).SetTitle("| Servers |") const shortcut = 97 // rune for "a" - for i, srv := range servers { + for i, _ := range servers { + srv := servers[i] list.AddItem(string(srv.Name), string(srv.Description), rune(shortcut+i), func() { ui.Pages.RemovePage("joinServer") -- cgit