From: Jeff Halter Date: Mon, 20 Nov 2023 21:34:51 +0000 (-0800) Subject: Fix bug in client tracker list (#106) X-Git-Url: https://git.r.bdr.sh/rbdr/mobius/commitdiff_plain/6e4c02b1b9793776a52cf8b1f914eeadd2bbb4b5?ds=sidebyside 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. --- 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")