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
This commit is contained in:
Gleidson Daniel Silva 2024-05-22 15:20:12 -04:00 committed by GitHub
parent b0c9e16507
commit a035211cdf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 2 deletions

View File

@ -182,7 +182,7 @@ const createOrUpdateSubscription = async (subscription: ISubscription, room: ISe
s.bannerClosed = false; s.bannerClosed = false;
} }
} }
if (sub.hideUnreadStatus) { if (sub.hideUnreadStatus && subscription.hasOwnProperty('hideUnreadStatus')) {
if (sub.hideUnreadStatus !== subscription.hideUnreadStatus) { if (sub.hideUnreadStatus !== subscription.hideUnreadStatus) {
s.hideUnreadStatus = !!subscription.hideUnreadStatus; s.hideUnreadStatus = !!subscription.hideUnreadStatus;
} }

View File

@ -123,7 +123,7 @@ const OMNICHANNEL_HEADER_IN_PROGRESS = 'Open_Livechats';
const OMNICHANNEL_HEADER_ON_HOLD = 'On_hold_Livechats'; const OMNICHANNEL_HEADER_ON_HOLD = 'On_hold_Livechats';
const QUERY_SIZE = 20; 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 filterIsFavorite = (s: TSubscriptionModel) => s.f;
const filterIsOmnichannel = (s: TSubscriptionModel) => s.t === 'l'; const filterIsOmnichannel = (s: TSubscriptionModel) => s.t === 'l';
const filterIsTeam = (s: TSubscriptionModel) => s.teamMain; const filterIsTeam = (s: TSubscriptionModel) => s.teamMain;