MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / clearMessageAfterDelay

Method clearMessageAfterDelay

internal/ui/components/header.go:185–207  ·  view source on GitHub ↗

Add a helper to clear the header message after a delay.

(delay time.Duration)

Source from the content-addressed store, hash-verified

183
184// Add a helper to clear the header message after a delay.
185func (h *Header) clearMessageAfterDelay(delay time.Duration) {
186 go func() {
187 time.Sleep(delay)
188
189 if h.app != nil {
190 h.app.QueueUpdateDraw(func() {
191 // Avoid overriding an active loading indicator that may have started after ShowSuccess/ShowError
192 h.mu.Lock()
193 loading := h.isLoading
194 h.mu.Unlock()
195 if loading {
196 return
197 }
198 // Restore the current profile if it exists, otherwise reset to default
199 if h.currentProfile != "" {
200 h.restoreProfile()
201 } else {
202 h.SetText(appName)
203 }
204 })
205 }
206 }()
207}
208
209// animateLoading displays an animated loading indicator.
210func (h *Header) animateLoading(ctx context.Context) {

Callers 3

ShowSuccessMethod · 0.95
ShowErrorMethod · 0.95
ShowWarningMethod · 0.95

Calls 3

restoreProfileMethod · 0.95
SetTextMethod · 0.95
QueueUpdateDrawMethod · 0.80

Tested by

no test coverage detected