Ensure new partswitcher doesn't start on multipart
This commit is contained in:
parent
6473848d87
commit
1d1fe7c7ef
|
@ -55,6 +55,7 @@ func NewMessageViewer(acct *AccountView, conf *config.AercConfig,
|
||||||
})
|
})
|
||||||
|
|
||||||
switcher := &PartSwitcher{}
|
switcher := &PartSwitcher{}
|
||||||
|
switcher.selected = -1
|
||||||
err := createSwitcher(switcher, conf, store, msg, conf.Viewer.ShowHeaders)
|
err := createSwitcher(switcher, conf, store, msg, conf.Viewer.ShowHeaders)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &MessageViewer{
|
return &MessageViewer{
|
||||||
|
@ -166,6 +167,7 @@ func createSwitcher(switcher *PartSwitcher, conf *config.AercConfig,
|
||||||
switcher.showHeaders = showHeaders
|
switcher.showHeaders = showHeaders
|
||||||
|
|
||||||
if len(msg.BodyStructure.Parts) == 0 {
|
if len(msg.BodyStructure.Parts) == 0 {
|
||||||
|
switcher.selected = 0
|
||||||
pv, err := NewPartViewer(conf, store, msg, msg.BodyStructure,
|
pv, err := NewPartViewer(conf, store, msg, msg.BodyStructure,
|
||||||
showHeaders, []int{1})
|
showHeaders, []int{1})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in New Issue