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