Commit b1ea5e0
committed
msglist: Make mark-as-read button listen to the Unreads model
Instead of just listening to PerAccountStore and (via an ancestor
widget) a MessageListView.
Issue #370 is relevant here -- "Maintain total unread counts
efficiently". The button causes linear scans through Unreads each
time it rebuilds, and ideally we'd avoid that, especially since now
it'll rebuild in more cases than it was before. I think the
additional cases aren't very many, though: I've thought of just one
kind of Zulip event that would cause Unreads but not PerAccountStore
and MessageListView to notify listeners, and I added a test
exercising that.1 parent 9296fb3 commit b1ea5e0
File tree
2 files changed
+61
-3
lines changed- lib/widgets
- test/widgets
2 files changed
+61
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
1416 | 1417 | | |
1417 | 1418 | | |
1418 | 1419 | | |
1419 | | - | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
1420 | 1423 | | |
1421 | 1424 | | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
1422 | 1444 | | |
1423 | 1445 | | |
1424 | 1446 | | |
| |||
1429 | 1451 | | |
1430 | 1452 | | |
1431 | 1453 | | |
1432 | | - | |
1433 | | - | |
| 1454 | + | |
1434 | 1455 | | |
1435 | 1456 | | |
1436 | 1457 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1001 | 1001 | | |
1002 | 1002 | | |
1003 | 1003 | | |
| 1004 | + | |
| 1005 | + | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
| 1031 | + | |
| 1032 | + | |
| 1033 | + | |
| 1034 | + | |
| 1035 | + | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
1004 | 1041 | | |
1005 | 1042 | | |
1006 | 1043 | | |
| |||
0 commit comments