From 245e9e7bcace454095acf8d232de34796c9ec086 Mon Sep 17 00:00:00 2001 From: Kosuke Saigusa Date: Fri, 11 Aug 2023 23:57:40 +0900 Subject: [PATCH] fix: fix unread count limit --- packages/mottai_flutter_app/lib/chat/chat_rooms.dart | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/mottai_flutter_app/lib/chat/chat_rooms.dart b/packages/mottai_flutter_app/lib/chat/chat_rooms.dart index c1f38b8e..9d47c1c2 100644 --- a/packages/mottai_flutter_app/lib/chat/chat_rooms.dart +++ b/packages/mottai_flutter_app/lib/chat/chat_rooms.dart @@ -43,8 +43,8 @@ final latestMessageProvider = /// 未読メッセージ数の最大値。 const _maxUnReadCount = 10; -/// 指定した `chatRoomId` における自分の未読メッセージ数を最大 [_maxUnReadCount] 件取得 -/// する [StreamProvider]. +/// 指定した `chatRoomId` における自分の未読メッセージ数を最大 [_maxUnReadCount] + 1 件 +/// 取得する [StreamProvider]. final _unReadCountStreamProvider = StreamProvider.autoDispose.family((ref, readChatRoom) { final readStatus = ref.watch(myReadStatusStreamProvider(readChatRoom)).value; @@ -54,7 +54,7 @@ final _unReadCountStreamProvider = .subscribeUnReadChatMessages( chatRoomId: readChatRoom.chatRoomId, lastReadAt: lastReadAt, - limit: _maxUnReadCount, + limit: _maxUnReadCount + 1, ) .map((messages) => messages.length); });