@@ -89,7 +89,6 @@ func NewModel(defaults resend.SendEmailRequest, deliveryMethod DeliveryMethod) M
8989 from := textinput .New ()
9090 from .Prompt = "From "
9191 from .Placeholder = "me@example.com"
92- from .PromptStyle = labelStyle .Copy ()
9392 from .PromptStyle = labelStyle
9493 from .TextStyle = textStyle
9594 from .Cursor .Style = cursorStyle
@@ -98,7 +97,7 @@ func NewModel(defaults resend.SendEmailRequest, deliveryMethod DeliveryMethod) M
9897
9998 to := textinput .New ()
10099 to .Prompt = "To "
101- to .PromptStyle = labelStyle . Copy ()
100+ to .PromptStyle = labelStyle
102101 to .Cursor .Style = cursorStyle
103102 to .PlaceholderStyle = placeholderStyle
104103 to .TextStyle = textStyle
@@ -107,7 +106,7 @@ func NewModel(defaults resend.SendEmailRequest, deliveryMethod DeliveryMethod) M
107106
108107 cc := textinput .New ()
109108 cc .Prompt = "Cc "
110- cc .PromptStyle = labelStyle . Copy ()
109+ cc .PromptStyle = labelStyle
111110 cc .Cursor .Style = cursorStyle
112111 cc .PlaceholderStyle = placeholderStyle
113112 cc .TextStyle = textStyle
@@ -116,7 +115,7 @@ func NewModel(defaults resend.SendEmailRequest, deliveryMethod DeliveryMethod) M
116115
117116 bcc := textinput .New ()
118117 bcc .Prompt = "Bcc "
119- bcc .PromptStyle = labelStyle . Copy ()
118+ bcc .PromptStyle = labelStyle
120119 bcc .Cursor .Style = cursorStyle
121120 bcc .PlaceholderStyle = placeholderStyle
122121 bcc .TextStyle = textStyle
@@ -125,7 +124,7 @@ func NewModel(defaults resend.SendEmailRequest, deliveryMethod DeliveryMethod) M
125124
126125 subject := textinput .New ()
127126 subject .Prompt = "Subject "
128- subject .PromptStyle = labelStyle . Copy ()
127+ subject .PromptStyle = labelStyle
129128 subject .Cursor .Style = cursorStyle
130129 subject .PlaceholderStyle = placeholderStyle
131130 subject .TextStyle = textStyle
@@ -221,7 +220,7 @@ func (m Model) Init() tea.Cmd {
221220type clearErrMsg struct {}
222221
223222func clearErrAfter (d time.Duration ) tea.Cmd {
224- return tea .Tick (d , func (t time.Time ) tea.Msg {
223+ return tea .Tick (d , func (_ time.Time ) tea.Msg {
225224 return clearErrMsg {}
226225 })
227226}
@@ -266,6 +265,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
266265 m .state = hoveringSendButton
267266 case hoveringSendButton :
268267 m .state = editingFrom
268+ case pickingFile , sendingEmail :
269269 }
270270 m .focusActiveInput ()
271271
@@ -292,6 +292,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
292292 m .state = editingBody
293293 case hoveringSendButton :
294294 m .state = editingAttachments
295+ case pickingFile , sendingEmail :
295296 }
296297 m .focusActiveInput ()
297298
@@ -353,6 +354,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
353354 case sendingEmail :
354355 m .loadingSpinner , cmd = m .loadingSpinner .Update (msg )
355356 cmds = append (cmds , cmd )
357+ case editingFrom , editingTo , editingCc , editingBcc , editingSubject , editingBody , hoveringSendButton :
356358 }
357359
358360 m .help , cmd = m .help .Update (msg )
@@ -419,6 +421,7 @@ func (m *Model) focusActiveInput() {
419421 case editingAttachments :
420422 m .Attachments .Styles .Title = activeLabelStyle
421423 m .Attachments .SetDelegate (attachmentDelegate {true })
424+ case hoveringSendButton , pickingFile , sendingEmail :
422425 }
423426}
424427
@@ -434,6 +437,7 @@ func (m Model) View() string {
434437 "\n \n " + m .filepicker .View ()
435438 case sendingEmail :
436439 return "\n " + m .loadingSpinner .View () + "Sending email"
440+ case editingFrom , editingTo , editingCc , editingBcc , editingSubject , editingBody , editingAttachments , hoveringSendButton :
437441 }
438442
439443 var s strings.Builder
0 commit comments