From 730494af988de9527bb5bd83181c14dbdcf0dcf4 Mon Sep 17 00:00:00 2001 From: derailed Date: Fri, 4 Dec 2020 05:20:13 -0700 Subject: [PATCH] fix typo and clean up prs --- internal/view/help.go | 2 +- internal/view/pf_dialog.go | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/internal/view/help.go b/internal/view/help.go index a673495d..d2cd6d75 100644 --- a/internal/view/help.go +++ b/internal/view/help.go @@ -56,7 +56,7 @@ func (h *Help) Init(ctx context.Context) error { } func (h *Help) bindKeys() { - h.Actions().Delete(ui.KeySpace, tcell.KeyCtrlSpace, tcell.KeyCtrlS), ui.KeySlash) + h.Actions().Delete(ui.KeySpace, tcell.KeyCtrlSpace, tcell.KeyCtrlS, ui.KeySlash) h.Actions().Set(ui.KeyActions{ tcell.KeyEscape: ui.NewKeyAction("Back", h.app.PrevCmd, true), ui.KeyHelp: ui.NewKeyAction("Back", h.app.PrevCmd, false), diff --git a/internal/view/pf_dialog.go b/internal/view/pf_dialog.go index d1aa6c89..ae00dc9a 100644 --- a/internal/view/pf_dialog.go +++ b/internal/view/pf_dialog.go @@ -31,8 +31,8 @@ func ShowPortForwards(v ResourceViewer, path string, ports []string, okFn PortFo address := v.App().Config.CurrentCluster().PortForwardAddress - p1, p2 := "", "" - if len(ports) != 0 { + var p1, p2 string + if len(ports) > 0 { p1, p2 = ports[0], extractPort(ports[0]) } @@ -88,8 +88,6 @@ func ShowPortForwards(v ResourceViewer, path string, ports []string, okFn PortFo if len(ports) != 0 { modal.SetText("Exposed Ports: " + strings.Join(ports, ",")) - } else { - modal.SetText("Exposed Ports: (none)") } modal.SetTextColor(styles.FgColor.Color())