MCPcopy
hub / github.com/noahgorstein/jqp / NewStatusMessage

Method NewStatusMessage

tui/bubbles/statusbar/statusbar.go:61–79  ·  view source on GitHub ↗
(s string, success bool)

Source from the content-addressed store, hash-verified

59type statusMessageTimeoutMsg struct{}
60
61func (b *Bubble) NewStatusMessage(s string, success bool) tea.Cmd {
62 if success {
63 b.statusMessage = b.styles.successMessageStyle.Render(s)
64 } else {
65 b.statusMessage = b.styles.errorMessageStyle.Render(s)
66 }
67
68 if b.statusMessageTimer != nil {
69 b.statusMessageTimer.Stop()
70 }
71
72 b.statusMessageTimer = time.NewTimer(b.StatusMessageLifetime)
73
74 // Wait for timeout
75 return func() tea.Msg {
76 <-b.statusMessageTimer.C
77 return statusMessageTimeoutMsg{}
78 }
79}

Callers 5

handleQueryResultMsgMethod · 0.80
handleWriteToFileMsgMethod · 0.80
handleErrorMsgMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected