mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Fix: Order of rooms.
This commit is contained in:
parent
0bd7968272
commit
21124bcd71
@ -257,7 +257,7 @@ export default {
|
||||
const rmsIds = []
|
||||
;[...Room, ...this.rooms].forEach((r) => {
|
||||
if (!rmsIds.find((v) => v === r.id)) {
|
||||
rms.push(this.fixRoomObject(r))
|
||||
rms.unshift(this.fixRoomObject(r))
|
||||
rmsIds.push(r.id)
|
||||
}
|
||||
})
|
||||
@ -405,7 +405,7 @@ export default {
|
||||
// This fixes the room object which arrives from the backend
|
||||
const fixedRoom = {
|
||||
...room,
|
||||
index: room.lastMessage?.date,
|
||||
index: room.lastMessage? room.lastMessage.date : room.createdAt,
|
||||
lastMessage: room.lastMessage
|
||||
? {
|
||||
...room.lastMessage,
|
||||
|
||||
@ -7,6 +7,7 @@ export const createRoom = () => gql`
|
||||
roomId
|
||||
roomName
|
||||
lastMessageAt
|
||||
createdAt
|
||||
unreadCount
|
||||
#avatar
|
||||
users {
|
||||
@ -29,6 +30,7 @@ export const roomQuery = () => gql`
|
||||
roomName
|
||||
avatar
|
||||
lastMessageAt
|
||||
createdAt
|
||||
unreadCount
|
||||
lastMessage {
|
||||
_id
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user