[FIX] Fix display order render on RoomListView (#4392)
This commit is contained in:
parent
aa1d9c35c2
commit
7aa94e0a9e
|
@ -530,21 +530,6 @@ class RoomsListView extends React.Component<IRoomsListViewProps, IRoomsListViewS
|
|||
let chats = data;
|
||||
|
||||
let omnichannelsUpdate: string[] = [];
|
||||
let chatsUpdate = [];
|
||||
if (showUnread) {
|
||||
/**
|
||||
* If unread on top, we trigger re-render based on order changes and sub.alert
|
||||
* RoomItem handles its own re-render
|
||||
*/
|
||||
chatsUpdate = data.map(item => ({ rid: item.rid, alert: item.alert }));
|
||||
} else {
|
||||
/**
|
||||
* Otherwise, we trigger re-render only when chats order changes
|
||||
* RoomItem handles its own re-render
|
||||
*/
|
||||
chatsUpdate = data.map(item => item.rid);
|
||||
}
|
||||
|
||||
const isOmnichannelAgent = user?.roles?.includes('livechat-agent');
|
||||
if (isOmnichannelAgent) {
|
||||
const omnichannel = chats.filter(s => filterIsOmnichannel(s));
|
||||
|
@ -586,6 +571,8 @@ class RoomsListView extends React.Component<IRoomsListViewProps, IRoomsListViewS
|
|||
tempChats = chats;
|
||||
}
|
||||
|
||||
const chatsUpdate = tempChats.map(item => item.rid);
|
||||
|
||||
this.internalSetState({
|
||||
chats: tempChats,
|
||||
chatsUpdate,
|
||||
|
|
Loading…
Reference in New Issue