ShowError displays an error message temporarily.
(message string)
| 118 | |
| 119 | // ShowError displays an error message temporarily. |
| 120 | func (h *Header) ShowError(message string) { |
| 121 | h.mu.Lock() |
| 122 | h.isLoading = false |
| 123 | if h.loadingCancel != nil { |
| 124 | h.loadingCancel() |
| 125 | h.loadingCancel = nil |
| 126 | } |
| 127 | h.mu.Unlock() |
| 128 | h.StopLoading() |
| 129 | h.SetText(theme.ReplaceSemanticTags("[error]✗ " + message + "[-]")) |
| 130 | |
| 131 | // Clear the message after 3 seconds |
| 132 | h.clearMessageAfterDelay(3 * time.Second) |
| 133 | } |
| 134 | |
| 135 | // ShowWarning displays a warning message temporarily. |
| 136 | func (h *Header) ShowWarning(message string) { |
nothing calls this directly
no test coverage detected