Skip to content

Commit 53853ab

Browse files
Lalit3716gnprice
authored andcommitted
unread: Rename countInAllMessagesNarrow method
Fixes: #676
1 parent 764338f commit 53853ab

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/model/unreads.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ class Unreads extends ChangeNotifier {
129129
final int selfUserId;
130130

131131
// TODO(#370): maintain this count incrementally, rather than recomputing from scratch
132-
int countInAllMessagesNarrow() {
132+
int countInCombinedFeedNarrow() {
133133
int c = 0;
134134
for (final messageIds in dms.values) {
135135
c = c + messageIds.length;
@@ -196,7 +196,7 @@ class Unreads extends ChangeNotifier {
196196
int countInNarrow(Narrow narrow) {
197197
switch (narrow) {
198198
case CombinedFeedNarrow():
199-
return countInAllMessagesNarrow();
199+
return countInCombinedFeedNarrow();
200200
case StreamNarrow():
201201
return countInStreamNarrow(narrow.streamId);
202202
case TopicNarrow():

test/model/unreads_test.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void main() {
152152
});
153153

154154
group('count helpers', () {
155-
test('countInAllMessagesNarrow', () async {
155+
test('countInCombinedFeedNarrow', () async {
156156
final stream1 = eg.stream(streamId: 1, name: 'stream 1');
157157
final stream2 = eg.stream(streamId: 2, name: 'stream 2');
158158
final stream3 = eg.stream(streamId: 3, name: 'stream 3');
@@ -171,7 +171,7 @@ void main() {
171171
eg.dmMessage(from: eg.otherUser, to: [eg.selfUser], flags: []),
172172
eg.dmMessage(from: eg.thirdUser, to: [eg.selfUser], flags: []),
173173
]);
174-
check(model.countInAllMessagesNarrow()).equals(5);
174+
check(model.countInCombinedFeedNarrow()).equals(5);
175175
});
176176

177177
test('countInStream/Narrow', () async {

0 commit comments

Comments
 (0)