lint fixes

This commit is contained in:
Ulf Gebhardt 2023-07-20 13:10:25 +02:00
parent 01fb28da3c
commit 70a1c52165
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 12 additions and 10 deletions

View File

@ -406,13 +406,15 @@ export default {
const fixedRoom = {
...room,
index: room.lastMessage?.date,
lastMessage: room.lastMessage ? {
lastMessage: room.lastMessage
? {
...room.lastMessage,
content: room.lastMessage?.content?.trim().substring(0, 30),
}: null,
}
: null,
users: room.users.map((u) => {
return { ...u, username: u.name, avatar: u.avatar?.url }
})
}),
}
if (!fixedRoom.avatar) {
// as long as we cannot query avatar on CreateRoom

View File

@ -23,7 +23,7 @@ export const createRoom = () => gql`
export const roomQuery = () => gql`
query Room($first: Int, $offset: Int, $id: ID) {
Room(first: $first, offset: $offset, id: $id, orderBy: [lastMessageAt_desc createdAt_desc] ) {
Room(first: $first, offset: $offset, id: $id, orderBy: [lastMessageAt_desc, createdAt_desc]) {
id
roomId
roomName