[FIX] Channels list not following the same sorting logic from web client (#2763)
This commit is contained in:
parent
796dc75882
commit
b8a9523e58
|
@ -15,9 +15,6 @@ export const merge = (subscription, room) => {
|
||||||
if (room) {
|
if (room) {
|
||||||
if (room._updatedAt) {
|
if (room._updatedAt) {
|
||||||
subscription.lastMessage = normalizeMessage(room.lastMessage);
|
subscription.lastMessage = normalizeMessage(room.lastMessage);
|
||||||
const updatedAt = room?._updatedAt ? new Date(room._updatedAt) : null;
|
|
||||||
const lastMessageTs = subscription?.lastMessage?.ts ? new Date(subscription.lastMessage.ts) : null;
|
|
||||||
subscription.roomUpdatedAt = Math.max(updatedAt, lastMessageTs);
|
|
||||||
subscription.description = room.description;
|
subscription.description = room.description;
|
||||||
subscription.topic = room.topic;
|
subscription.topic = room.topic;
|
||||||
subscription.announcement = room.announcement;
|
subscription.announcement = room.announcement;
|
||||||
|
@ -28,6 +25,9 @@ export const merge = (subscription, room) => {
|
||||||
subscription.usernames = room.usernames;
|
subscription.usernames = room.usernames;
|
||||||
subscription.uids = room.uids;
|
subscription.uids = room.uids;
|
||||||
}
|
}
|
||||||
|
// https://github.com/RocketChat/Rocket.Chat/blob/develop/app/ui-sidenav/client/roomList.js#L180
|
||||||
|
const lastRoomUpdate = room.lm || subscription.ts || subscription._updatedAt;
|
||||||
|
subscription.roomUpdatedAt = subscription.lr ? Math.max(new Date(subscription.lr), new Date(lastRoomUpdate)) : lastRoomUpdate;
|
||||||
subscription.ro = room.ro;
|
subscription.ro = room.ro;
|
||||||
subscription.broadcast = room.broadcast;
|
subscription.broadcast = room.broadcast;
|
||||||
subscription.encrypted = room.encrypted;
|
subscription.encrypted = room.encrypted;
|
||||||
|
|
Loading…
Reference in New Issue