mirror of
https://github.com/ivabus/pop
synced 2025-06-08 08:00:27 +03:00
fix: don't print emailSummary when aborting
This commit is contained in:
parent
1fdf21c19d
commit
6879387140
2 changed files with 5 additions and 1 deletions
4
main.go
4
main.go
|
@ -58,7 +58,9 @@ var rootCmd = &cobra.Command{
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
mm := m.(Model)
|
mm := m.(Model)
|
||||||
fmt.Print(emailSummary(strings.Split(mm.To.Value(), TO_SEPARATOR), mm.Subject.Value()))
|
if !mm.abort {
|
||||||
|
fmt.Print(emailSummary(strings.Split(mm.To.Value(), TO_SEPARATOR), mm.Subject.Value()))
|
||||||
|
}
|
||||||
return nil
|
return nil
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
2
model.go
2
model.go
|
@ -53,6 +53,7 @@ type Model struct {
|
||||||
help help.Model
|
help help.Model
|
||||||
keymap KeyMap
|
keymap KeyMap
|
||||||
quitting bool
|
quitting bool
|
||||||
|
abort bool
|
||||||
err error
|
err error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -230,6 +231,7 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
|
||||||
m.Attachments.SetHeight(max(len(m.Attachments.Items()), 1) + 2)
|
m.Attachments.SetHeight(max(len(m.Attachments.Items()), 1) + 2)
|
||||||
case key.Matches(msg, m.keymap.Quit):
|
case key.Matches(msg, m.keymap.Quit):
|
||||||
m.quitting = true
|
m.quitting = true
|
||||||
|
m.abort = true
|
||||||
return m, tea.Quit
|
return m, tea.Quit
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue