Skip to content

Commit

Permalink
Merge pull request #50 from ewilliams0305/refresh
Browse files Browse the repository at this point in the history
mapped refresh to device info command
  • Loading branch information
ewilliams0305 committed Dec 30, 2023
2 parents 101bc68 + d526a54 commit 58872f2
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions pkg/tui/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,38 +165,31 @@ func (m MainModel) View() string {
s += BaseStyle.Render(info.Table.View()) + "\n"
}

// Iterate over our choices
for i, choice := range m.actions {

// Is the cursor pointing at this choice?
cursor := GreyedOutText.Render(" "+" "+choice) + "\n"
if m.cursor == i {
cursor = HighlightedText.Render("\u2192"+" "+choice) + "\n"
}
s += cursor

}

// The footer
s += m.help.renderHelpInfo()
return s
}

func arrowSelected(m *MainModel) (tea.Model, tea.Cmd) {

switch m.cursor {
case 0:
return m, DeviceInfoCommand
case int(programs):
m.state = programs
return InitialProgramsModel(m.width, m.height), ProgramsQuery

case int(rooms):
m.state = rooms
return InitialRoomsModel(m.width, m.height), RoomsQuery

case int(info):
m.state = info
return NewDeviceInfo(m.width, m.height), DeviceInfoCommand

case int(auth):
case int(devices):
case int(systemd):
Expand Down

0 comments on commit 58872f2

Please sign in to comment.