[FIX] Fix display order render on RoomListView (#4392)
This commit is contained in:
parent
41dbbf4d4b
commit
2c32be6e51
|
@ -530,21 +530,6 @@ class RoomsListView extends React.Component<IRoomsListViewProps, IRoomsListViewS
|
||||||
let chats = data;
|
let chats = data;
|
||||||
|
|
||||||
let omnichannelsUpdate: string[] = [];
|
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');
|
const isOmnichannelAgent = user?.roles?.includes('livechat-agent');
|
||||||
if (isOmnichannelAgent) {
|
if (isOmnichannelAgent) {
|
||||||
const omnichannel = chats.filter(s => filterIsOmnichannel(s));
|
const omnichannel = chats.filter(s => filterIsOmnichannel(s));
|
||||||
|
@ -586,6 +571,8 @@ class RoomsListView extends React.Component<IRoomsListViewProps, IRoomsListViewS
|
||||||
tempChats = chats;
|
tempChats = chats;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const chatsUpdate = tempChats.map(item => item.rid);
|
||||||
|
|
||||||
this.internalSetState({
|
this.internalSetState({
|
||||||
chats: tempChats,
|
chats: tempChats,
|
||||||
chatsUpdate,
|
chatsUpdate,
|
||||||
|
|
Loading…
Reference in New Issue