Skip to content

Commit

Permalink
unread: Rename countInAllMessagesNarrow method
Browse files Browse the repository at this point in the history
Fixes: #676
  • Loading branch information
Lalit3716 authored and gnprice committed May 28, 2024
1 parent 764338f commit 53853ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/model/unreads.dart
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class Unreads extends ChangeNotifier {
final int selfUserId;

// TODO(#370): maintain this count incrementally, rather than recomputing from scratch
int countInAllMessagesNarrow() {
int countInCombinedFeedNarrow() {
int c = 0;
for (final messageIds in dms.values) {
c = c + messageIds.length;
Expand Down Expand Up @@ -196,7 +196,7 @@ class Unreads extends ChangeNotifier {
int countInNarrow(Narrow narrow) {
switch (narrow) {
case CombinedFeedNarrow():
return countInAllMessagesNarrow();
return countInCombinedFeedNarrow();
case StreamNarrow():
return countInStreamNarrow(narrow.streamId);
case TopicNarrow():
Expand Down
4 changes: 2 additions & 2 deletions test/model/unreads_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ void main() {
});

group('count helpers', () {
test('countInAllMessagesNarrow', () async {
test('countInCombinedFeedNarrow', () async {
final stream1 = eg.stream(streamId: 1, name: 'stream 1');
final stream2 = eg.stream(streamId: 2, name: 'stream 2');
final stream3 = eg.stream(streamId: 3, name: 'stream 3');
Expand All @@ -171,7 +171,7 @@ void main() {
eg.dmMessage(from: eg.otherUser, to: [eg.selfUser], flags: []),
eg.dmMessage(from: eg.thirdUser, to: [eg.selfUser], flags: []),
]);
check(model.countInAllMessagesNarrow()).equals(5);
check(model.countInCombinedFeedNarrow()).equals(5);
});

test('countInStream/Narrow', () async {
Expand Down

0 comments on commit 53853ab

Please sign in to comment.