aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/aerc.go
diff options
context:
space:
mode:
authorRobin Jarry <robin@jarry.cc>2022-09-14 21:09:02 +0200
committerRobin Jarry <robin@jarry.cc>2022-09-14 22:11:33 +0200
commitee7937d0dd9201fdb78f363ddc8af950d0778f1b (patch)
tree33d827476be133aad84086b3d56b8b5ee0dbefd8 /widgets/aerc.go
parentd93ad24f5f8f1f9204b5951abcb4691c9fd0b80f (diff)
downloadaerc-ee7937d0dd9201fdb78f363ddc8af950d0778f1b.tar.gz
ui: cleanup internals and api
Now that tcell events are handled in a goroutine, no need for a channel to buffer them. Rename ui.Tick() to ui.Render() and ui.Run() to ui.ProcessEvents() to better reflect what these functions do. Move screen.PollEvent() into ui.ProcessEvents(). Register the panic handler in ui.ProcessEvents(). Remove aerc.ui.Tick() from DecryptKeys(). What the hell was that? Signed-off-by: Robin Jarry <robin@jarry.cc> Tested-by: Tim Culverhouse <tim@timculverhouse.com>
Diffstat (limited to 'widgets/aerc.go')
-rw-r--r--widgets/aerc.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/widgets/aerc.go b/widgets/aerc.go
index f0bc1ba7..cbc37795 100644
--- a/widgets/aerc.go
+++ b/widgets/aerc.go
@@ -743,18 +743,13 @@ func (aerc *Aerc) DecryptKeys(keys []openpgp.Key, symmetric bool) (b []byte, err
fmt.Sprintf("Enter password for %s (%8X)\nPress <ESC> to cancel",
ident.Name, key.PublicKey.KeyId))
- for {
- select {
- case err = <-chErr:
- if err != nil {
- return nil, err
- }
- pass := <-chPass
- err = key.PrivateKey.Decrypt([]byte(pass))
+ for err := range chErr {
+ if err != nil {
return nil, err
- default:
- aerc.ui.Tick()
}
+ pass := <-chPass
+ err = key.PrivateKey.Decrypt([]byte(pass))
+ return nil, err
}
}
return nil, err