Skip to content

Commit

Permalink
refresh table after suspending it
Browse files Browse the repository at this point in the history
  • Loading branch information
yogin committed Mar 4, 2021
1 parent 2517da2 commit 36c01f5
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions service/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,7 @@ func (s *Service) Run() {
s.table.SetInputCapture(func(event *tcell.EventKey) *tcell.EventKey {
switch event.Rune() {
case 'r', 'R':
s.fetchInstances()
s.updateTable()
s.refreshTable()
return nil

// case 's':
Expand All @@ -90,6 +89,8 @@ func (s *Service) Run() {
}

func (s *Service) handleSelected(row int, col int) {
defer s.refreshTable()

cell := s.table.GetCell(row, col)
ref := cell.GetReference()
instance, ok := s.instances[ref.(string)]
Expand All @@ -101,6 +102,11 @@ func (s *Service) handleSelected(row int, col int) {
}
}

func (s *Service) refreshTable() {
s.fetchInstances()
s.updateTable()
}

func (s *Service) ec2svc() {
creds := credentials.NewChainCredentials(
[]credentials.Provider{
Expand Down

0 comments on commit 36c01f5

Please sign in to comment.