From 4532a6929c868e970c12b9bb0d4910120c48c9cd Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Mon, 28 Nov 2022 17:23:19 -0300 Subject: [PATCH] Fix types and remove omichannelsUpdate --- app/views/RoomsListView/index.tsx | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/app/views/RoomsListView/index.tsx b/app/views/RoomsListView/index.tsx index f30e78d17..f5312308d 100644 --- a/app/views/RoomsListView/index.tsx +++ b/app/views/RoomsListView/index.tsx @@ -105,7 +105,6 @@ interface IRoomsListViewState { searching?: boolean; search?: IRoomItem[]; loading?: boolean; - omnichannelsUpdate?: string[]; chats?: IRoomItem[]; item?: ISubscription; canCreateRoom?: boolean; @@ -158,7 +157,6 @@ class RoomsListView extends React.Component { + addRoomsGroup = (data: ISubscription[], header: string, allData: ISubscription[]) => { if (data.length > 0) { if (header) { allData.push({ rid: header, separator: true } as TSubscriptionModel); @@ -414,18 +412,15 @@ class RoomsListView extends React.Component { - console.log('update query'); - let tempChats = [] as TSubscriptionModel[]; + let tempChats: ISubscription[] = []; let chats = data.map(item => item.asPlain()); - let omnichannelsUpdate: string[] = []; const isOmnichannelAgent = user?.roles?.includes('livechat-agent'); if (isOmnichannelAgent) { const omnichannel = chats.filter(s => filterIsOmnichannel(s)); const omnichannelInProgress = omnichannel.filter(s => !s.onHold); const omnichannelOnHold = omnichannel.filter(s => s.onHold); chats = chats.filter(s => !filterIsOmnichannel(s)); - omnichannelsUpdate = omnichannelInProgress.map(s => s.rid); tempChats = this.addRoomsGroup(omnichannelInProgress, OMNICHANNEL_HEADER_IN_PROGRESS, tempChats); tempChats = this.addRoomsGroup(omnichannelOnHold, OMNICHANNEL_HEADER_ON_HOLD, tempChats); } @@ -457,13 +452,11 @@ class RoomsListView extends React.Component