Explorar o código

Only allow focus on guilds tree if it exists (#350)

cyberme0w %!s(int64=2) %!d(string=hai) anos
pai
achega
c07731a98d
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      cmd/main_flex.go

+ 3 - 1
cmd/main_flex.go

@@ -57,7 +57,9 @@ func (mf *MainFlex) onInputCapture(event *tcell.EventKey) *tcell.EventKey {
 
 		return nil
 	case cfg.Keys.GuildsTree.Focus:
-		app.SetFocus(mf.guildsTree)
+		if mf.GetItemCount() == 2 {
+			app.SetFocus(mf.guildsTree)
+		}
 		return nil
 	case cfg.Keys.MessagesText.Focus:
 		app.SetFocus(mf.messagesText)