From a035211cdf0549d927dfa9a331c96fceb685d3e1 Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Wed, 22 May 2024 15:20:12 -0400 Subject: [PATCH] regression: checks if the `hideUnreadStatus` property is coming from the subscription (#5649) * regression: checks if the hideUnreadStatus property is coming from the subscription * fix: puts the rule closer to the web * fix: use hasOwnProperty to check hideUnreadStatus comparison --- app/lib/methods/subscriptions/rooms.ts | 2 +- app/views/RoomsListView/index.tsx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/methods/subscriptions/rooms.ts b/app/lib/methods/subscriptions/rooms.ts index efa8df02c..cc79ccb2e 100644 --- a/app/lib/methods/subscriptions/rooms.ts +++ b/app/lib/methods/subscriptions/rooms.ts @@ -182,7 +182,7 @@ const createOrUpdateSubscription = async (subscription: ISubscription, room: ISe s.bannerClosed = false; } } - if (sub.hideUnreadStatus) { + if (sub.hideUnreadStatus && subscription.hasOwnProperty('hideUnreadStatus')) { if (sub.hideUnreadStatus !== subscription.hideUnreadStatus) { s.hideUnreadStatus = !!subscription.hideUnreadStatus; } diff --git a/app/views/RoomsListView/index.tsx b/app/views/RoomsListView/index.tsx index b6a2c20d4..37ffb4e55 100644 --- a/app/views/RoomsListView/index.tsx +++ b/app/views/RoomsListView/index.tsx @@ -123,7 +123,7 @@ const OMNICHANNEL_HEADER_IN_PROGRESS = 'Open_Livechats'; const OMNICHANNEL_HEADER_ON_HOLD = 'On_hold_Livechats'; const QUERY_SIZE = 20; -const filterIsUnread = (s: TSubscriptionModel) => (s.unread > 0 || s.tunread?.length > 0 || s.alert) && !s.hideUnreadStatus; +const filterIsUnread = (s: TSubscriptionModel) => (s.alert || s.unread) && !s.hideUnreadStatus; const filterIsFavorite = (s: TSubscriptionModel) => s.f; const filterIsOmnichannel = (s: TSubscriptionModel) => s.t === 'l'; const filterIsTeam = (s: TSubscriptionModel) => s.teamMain;