소스 검색

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

cyberme0w 2 년 전
부모
커밋
c07731a98d
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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)