Skip to content

Commit

Permalink
Merge pull request #14 from snes2c64/13-port-chooser-always-chooses-l…
Browse files Browse the repository at this point in the history
…ast-port-in-list

Fix always chosing wrong port
  • Loading branch information
dithmer authored Mar 28, 2023
2 parents 26859d5 + 02d317f commit 2ec5c50
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions cmd/gui/components/connect_modal.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,11 @@ func (c *ConnectModal) RefreshPorts() {
c.serialPortButtonGrid.Objects = nil

for i := range serialPorts {
portButton := widget.NewButton(serialPorts[i], func() {
port := serialPorts[i]

portButton := widget.NewButton(port, func() {
c.Modal.Hide()
c.OnConnect(serialPorts[i])
c.OnConnect(port)
})
c.serialPortButtonGrid.Add(portButton)
}
Expand Down

0 comments on commit 2ec5c50

Please sign in to comment.