about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJeffas <dev@jeffas.io>2020-02-29 04:03:09 +0000
committerDrew DeVault <sir@cmpwn.com>2020-02-28 23:03:34 -0500
commite661ead57b220ea0cf1d7382307b51563c6fc9c6 (patch)
tree00c616d8ef39991d950e47cfaff8b35521240bd3
parentb55813f2c0e96e0350473d96dc2dd82f0544ea8f (diff)
downloadaerc-e661ead57b220ea0cf1d7382307b51563c6fc9c6.tar.gz
Only show spinner while sorting if no uids
This fixes the problem where we already have messages and then have to
sort again.
-rw-r--r--widgets/msglist.go14
1 files changed, 7 insertions, 7 deletions
diff --git a/widgets/msglist.go b/widgets/msglist.go
index 59abf59..7c1a03b 100644
--- a/widgets/msglist.go
+++ b/widgets/msglist.go
@@ -63,12 +63,6 @@ func (ml *MessageList) Draw(ctx *ui.Context) {
 		}
 	}
 
-	if store.Sorting {
-		ml.spinner.Start()
-		ml.spinner.Draw(ctx)
-		return
-	}
-
 	var (
 		needsHeaders []uint32
 		row          int = 0
@@ -134,7 +128,13 @@ func (ml *MessageList) Draw(ctx *ui.Context) {
 	}
 
 	if len(uids) == 0 {
-		ml.drawEmptyMessage(ctx)
+		if store.Sorting {
+			ml.spinner.Start()
+			ml.spinner.Draw(ctx)
+			return
+		} else {
+			ml.drawEmptyMessage(ctx)
+		}
 	}
 
 	if len(needsHeaders) != 0 {