From 36f201d5d3aaba7e0285d86cf1c0cf6b54769cff Mon Sep 17 00:00:00 2001 From: Kujtim Hoxha Date: Thu, 10 Apr 2025 13:29:44 +0200 Subject: fix logs and add cancellation --- internal/tui/components/core/status.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'internal/tui/components/core') diff --git a/internal/tui/components/core/status.go b/internal/tui/components/core/status.go index d67bdb7a6..93ba34507 100644 --- a/internal/tui/components/core/status.go +++ b/internal/tui/components/core/status.go @@ -13,7 +13,7 @@ import ( ) type statusCmp struct { - info *util.InfoMsg + info util.InfoMsg width int messageTTL time.Duration } @@ -35,14 +35,14 @@ func (m statusCmp) Update(msg tea.Msg) (tea.Model, tea.Cmd) { m.width = msg.Width return m, nil case util.InfoMsg: - m.info = &msg + m.info = msg ttl := msg.TTL if ttl == 0 { ttl = m.messageTTL } return m, m.clearMessageCmd(ttl) case util.ClearStatusMsg: - m.info = nil + m.info = util.InfoMsg{} } return m, nil } @@ -54,7 +54,7 @@ var ( func (m statusCmp) View() string { status := styles.Padded.Background(styles.Grey).Foreground(styles.Text).Render("? help") - if m.info != nil { + if m.info.Msg != "" { infoStyle := styles.Padded. Foreground(styles.Base). Width(m.availableFooterMsgWidth()) -- cgit v1.2.3