Fixed wrong chat-count in Notification
This commit is contained in:
parent
ca9cf687ea
commit
a73aea0986
lib
@ -24,7 +24,7 @@ class NotificationController {
|
||||
),
|
||||
).run().then((value) {
|
||||
var messageCount = value.data.map((e) => e.unreadMessages).reduce((a, b) => a + b);
|
||||
var chatCount = value.data.map((e) => e.unreadMessages).length;
|
||||
var chatCount = value.data.where((e) => e.unreadMessages > 0).length;
|
||||
var people = value.data.where((e) => e.unreadMessages > 0).map((e) => e.displayName.split(" ")[0]);
|
||||
|
||||
final NotificationService service = NotificationService();
|
||||
|
@ -27,7 +27,9 @@ class _ChatListState extends State<ChatList> {
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
FirebaseMessaging.instance.requestPermission();
|
||||
FirebaseMessaging.instance.requestPermission(
|
||||
provisional: false
|
||||
);
|
||||
|
||||
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
|
||||
_query();
|
||||
|
Loading…
x
Reference in New Issue
Block a user