Skip to content

Commit

Permalink
fix: fix unread count limit
Browse files Browse the repository at this point in the history
  • Loading branch information
kosukesaigusa committed Aug 11, 2023
1 parent 1374f9b commit 245e9e7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/mottai_flutter_app/lib/chat/chat_rooms.dart
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ final latestMessageProvider =
/// 未読メッセージ数の最大値。
const _maxUnReadCount = 10;

/// 指定した `chatRoomId` における自分の未読メッセージ数を最大 [_maxUnReadCount] 件取得
/// する [StreamProvider].
/// 指定した `chatRoomId` における自分の未読メッセージ数を最大 [_maxUnReadCount] + 1 件
/// 取得する [StreamProvider].
final _unReadCountStreamProvider =
StreamProvider.autoDispose.family<int, ReadChatRoom>((ref, readChatRoom) {
final readStatus = ref.watch(myReadStatusStreamProvider(readChatRoom)).value;
Expand All @@ -54,7 +54,7 @@ final _unReadCountStreamProvider =
.subscribeUnReadChatMessages(
chatRoomId: readChatRoom.chatRoomId,
lastReadAt: lastReadAt,
limit: _maxUnReadCount,
limit: _maxUnReadCount + 1,
)
.map((messages) => messages.length);
});
Expand Down

0 comments on commit 245e9e7

Please sign in to comment.