fix: unread chats bug

This commit is contained in:
Freek van de Ven 2023-11-24 13:31:20 +01:00
parent d870b8424b
commit d0933ac252
7 changed files with 16 additions and 12 deletions

View file

@ -1,3 +1,7 @@
## 0.4.2 - November 24 2023
- Fix groupchats seen as personal chat when there are unread messages
## 0.4.1 - November 22 2023
- Add groupName for groupchat avatarbuilder

View file

@ -4,7 +4,7 @@
name: flutter_community_chat
description: A new Flutter package project.
version: 0.4.1
version: 0.4.2
publish_to: none
@ -19,12 +19,12 @@ dependencies:
git:
url: https://github.com/Iconica-Development/flutter_community_chat
path: packages/flutter_community_chat_view
ref: 0.4.1
ref: 0.4.2
flutter_community_chat_interface:
git:
url: https://github.com/Iconica-Development/flutter_community_chat
path: packages/flutter_community_chat_interface
ref: 0.4.1
ref: 0.4.2
dev_dependencies:
flutter_lints: ^2.0.0

View file

@ -289,7 +289,7 @@ class FirebaseChatService implements ChatService {
.doc(chatId)
.get();
if (chatCollection.exists) {
if (chatCollection.exists && chatCollection.data()?['users'] != null) {
var otherUser = chatCollection.data()?['users'].firstWhere(
(element) => element != currentUser?.id,
);
@ -317,7 +317,7 @@ class FirebaseChatService implements ChatService {
}
}
return GroupChatModel(
id: chat?.id ?? '',
id: chat?.id ?? chatId,
title: chat?.title ?? '',
imageUrl: chat?.imageUrl ?? '',
users: users,
@ -376,7 +376,7 @@ class FirebaseChatService implements ChatService {
return chat;
}
List<String> userIds = [
var userIds = <String>[
currentUser!.id!,
chat.user.id!,
];

View file

@ -4,7 +4,7 @@
name: flutter_community_chat_firebase
description: A new Flutter package project.
version: 0.4.1
version: 0.4.2
publish_to: none
environment:
@ -23,7 +23,7 @@ dependencies:
git:
url: https://github.com/Iconica-Development/flutter_community_chat
path: packages/flutter_community_chat_interface
ref: 0.4.1
ref: 0.4.2
dev_dependencies:
flutter_lints: ^2.0.0

View file

@ -4,7 +4,7 @@
name: flutter_community_chat_interface
description: A new Flutter package project.
version: 0.4.1
version: 0.4.2
publish_to: none
environment:

View file

@ -18,7 +18,7 @@ dependencies:
git:
url: https://github.com/Iconica-Development/flutter_community_chat
path: packages/flutter_community_chat_view
ref: 0.4.1
ref: 0.4.2
dev_dependencies:
flutter_test:

View file

@ -4,7 +4,7 @@
name: flutter_community_chat_view
description: A standard flutter package.
version: 0.4.1
version: 0.4.2
publish_to: none
@ -20,7 +20,7 @@ dependencies:
git:
url: https://github.com/Iconica-Development/flutter_community_chat
path: packages/flutter_community_chat_interface
ref: 0.4.1
ref: 0.4.2
cached_network_image: ^3.2.2
flutter_image_picker:
git: