ShowSuccess displays a success message temporarily.
(message string)
| 101 | |
| 102 | // ShowSuccess displays a success message temporarily. |
| 103 | func (h *Header) ShowSuccess(message string) { |
| 104 | // Mark not loading before changing text to prevent race with animateLoading |
| 105 | h.mu.Lock() |
| 106 | h.isLoading = false |
| 107 | if h.loadingCancel != nil { |
| 108 | h.loadingCancel() |
| 109 | h.loadingCancel = nil |
| 110 | } |
| 111 | h.mu.Unlock() |
| 112 | h.StopLoading() |
| 113 | h.SetText(theme.ReplaceSemanticTags("[success]✓ " + message + "[-]")) |
| 114 | |
| 115 | // Clear the message after 2 seconds (shorter than error messages) |
| 116 | h.clearMessageAfterDelay(2 * time.Second) |
| 117 | } |
| 118 | |
| 119 | // ShowError displays an error message temporarily. |
| 120 | func (h *Header) ShowError(message string) { |
nothing calls this directly
no test coverage detected