Allow open to be asynchronous
This stops the ui being blocked while the resource is opened. The wait ensures that resources are reclaimed when the process finishes while aerc is still running.
This commit is contained in:
parent
3e6189f243
commit
fda3f43e7c
4 changed files with 29 additions and 8 deletions
commands/msgview
|
@ -60,10 +60,9 @@ func (Open) Execute(aerc *widgets.Aerc, args []string) error {
|
|||
return
|
||||
}
|
||||
|
||||
err = lib.OpenFile(tmpFile.Name())
|
||||
if err != nil {
|
||||
lib.OpenFile(tmpFile.Name(), func(err error) {
|
||||
aerc.PushError(" " + err.Error())
|
||||
}
|
||||
})
|
||||
|
||||
aerc.PushStatus("Opened", 10*time.Second)
|
||||
})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue