on main help sign in
fix: suppress message when clipboard is empty (#2361)
ef0671cAndrey Nering
internal/ui/model/ui.go+2−2
@@ -3131,13 +3131,13 @@ func (m *UI) pasteImageFromClipboard() tea.Msg {
3131
3131
3132 textData, textErr := readClipboard(clipboardFormatText)
3132 textData, textErr := readClipboard(clipboardFormatText)
3133 if textErr != nil || len(textData) == 0 {
3133 if textErr != nil || len(textData) == 0 {
3134− return util.NewInfoMsg("Clipboard is empty or does not contain an image")
3134+ return nil // Clipboard is empty or does not contain an image
3135 }
3135 }
3136
3136
3137 path := strings.TrimSpace(string(textData))
3137 path := strings.TrimSpace(string(textData))
3138 path = strings.ReplaceAll(path, "\\ ", " ")
3138 path = strings.ReplaceAll(path, "\\ ", " ")
3139 if _, statErr := os.Stat(path); statErr != nil {
3139 if _, statErr := os.Stat(path); statErr != nil {
3140− return util.NewInfoMsg("Clipboard does not contain an image or valid file path")
3140+ return nil // Clipboard does not contain an image or valid file path
3141 }
3141 }
3142
3142
3143 lowerPath := strings.ToLower(path)
3143 lowerPath := strings.ToLower(path)