Pārlūkot izejas kodu

Revert "refactor: return nil outside the switch statement"

This reverts commit 3cafdcddefb01cdccbbb76084540baf696d150f6.
ayn2op 1 gadu atpakaļ
vecāks
revīzija
e9eb04991f
1 mainītis faili ar 8 papildinājumiem un 1 dzēšanām
  1. 8 1
      cmd/app.go

+ 8 - 1
cmd/app.go

@@ -104,10 +104,13 @@ func (app *App) onFlexInputCapture(event *tcell.EventKey) *tcell.EventKey {
 	switch event.Name() {
 	case app.cfg.Keys.FocusGuildsTree:
 		app.SetFocus(app.guildsTree)
+		return nil
 	case app.cfg.Keys.FocusMessagesText:
 		app.SetFocus(app.messagesText)
+		return nil
 	case app.cfg.Keys.FocusMessageInput:
 		app.SetFocus(app.messageInput)
+		return nil
 	case app.cfg.Keys.Logout:
 		app.Stop()
 
@@ -115,6 +118,8 @@ func (app *App) onFlexInputCapture(event *tcell.EventKey) *tcell.EventKey {
 			slog.Error("failed to delete token from keyring", "err", err)
 			return nil
 		}
+
+		return nil
 	case app.cfg.Keys.ToggleGuildsTree:
 		// The guilds tree is visible if the numbers of items is two.
 		if app.flex.GetItemCount() == 2 {
@@ -127,7 +132,9 @@ func (app *App) onFlexInputCapture(event *tcell.EventKey) *tcell.EventKey {
 			app.init()
 			app.SetFocus(app.guildsTree)
 		}
+
+		return nil
 	}
 
-	return nil
+	return event
 }