summary refs log tree commit diff stats
path: root/widgets/account.go
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2019-03-14 22:41:43 -0400
committerDrew DeVault <sir@cmpwn.com>2019-03-14 22:41:43 -0400
commit4ec7f5dea5f98ef5a8cddb84986ac52a2f7a1270 (patch)
tree3b82a140ffb390454e69a4c0a276468f54e2095a /widgets/account.go
parent62946ff6c5712bebf7f07a83fc077d40db0e73a8 (diff)
downloadaerc-4ec7f5dea5f98ef5a8cddb84986ac52a2f7a1270.tar.gz
Use cached message store when re-opening dirs
Diffstat (limited to 'widgets/account.go')
-rw-r--r--widgets/account.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/widgets/account.go b/widgets/account.go
index d22b1c6..82d2cad 100644
--- a/widgets/account.go
+++ b/widgets/account.go
@@ -177,7 +177,15 @@ func (acct *AccountView) onMessage(msg types.WorkerMessage) {
 	case *types.Done:
 		switch msg.InResponseTo().(type) {
 		case *types.OpenDirectory:
-			acct.msglist.SetStore(nil)
+			if store, ok := acct.msgStores[acct.dirlist.selected]; ok {
+				// If we've opened this dir before, we can re-render it from
+				// memory while we wait for the update and the UI feels
+				// snappier. If not, we'll unset the store and show the spinner
+				// while we download the UID list.
+				acct.msglist.SetStore(store)
+			} else {
+				acct.msglist.SetStore(nil)
+			}
 			acct.worker.PostAction(&types.FetchDirectoryContents{},
 				func(msg types.WorkerMessage) {
 					store := acct.msgStores[acct.dirlist.selected]
lass='alt'>
2349b7d ^

cf66462 ^
257affc ^
2349b7d ^




257affc ^
2349b7d ^
257affc ^


cf66462 ^


2349b7d ^



cf66462 ^

2750f99 ^
cf66462 ^


2349b7d ^
257affc ^
2349b7d ^


257affc ^


2349b7d ^


24196d2 ^
257affc ^




cf66462 ^
257affc ^





cf66462 ^






257affc ^

2349b7d ^
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87