From f4bf92080c3b81d7822cd294b2137acd1b3cfc76 Mon Sep 17 00:00:00 2001 From: Jorge Cervantes Date: Mon, 5 Sep 2022 18:49:35 -0500 Subject: [PATCH] Fix searchChats function searchChats have closedChatsOnly and served condition wrong, this make as result that not appear Chat History on the room --- apps/meteor/app/livechat/server/api/lib/visitors.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/meteor/app/livechat/server/api/lib/visitors.js b/apps/meteor/app/livechat/server/api/lib/visitors.js index cfa62ead68d64..b16bb4eeea4d6 100644 --- a/apps/meteor/app/livechat/server/api/lib/visitors.js +++ b/apps/meteor/app/livechat/server/api/lib/visitors.js @@ -86,13 +86,13 @@ export async function searchChats({ const [total] = await LivechatRooms.findRoomsByVisitorIdAndMessageWithCriteria({ visitorId, open: closedChatsOnly !== 'true', - served: served !== 'true', + served: served === 'true', searchText, onlyCount: true, }).toArray(); const cursor = await LivechatRooms.findRoomsByVisitorIdAndMessageWithCriteria({ visitorId, - open: closedChatsOnly === 'true', + open: closedChatsOnly !== 'true', served: served === 'true', searchText, options,