mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Add fetchRooms option & check null on content.
This commit is contained in:
parent
b881daef91
commit
6659238fa1
@ -261,7 +261,7 @@ export default {
|
|||||||
index: r.lastMessage?.date,
|
index: r.lastMessage?.date,
|
||||||
lastMessage: {
|
lastMessage: {
|
||||||
...r.lastMessage,
|
...r.lastMessage,
|
||||||
content: r.lastMessage?.content.trim().substring(0, 30),
|
content: r.lastMessage?.content?.trim().substring(0, 30),
|
||||||
},
|
},
|
||||||
users: r.users.map((u) => {
|
users: r.users.map((u) => {
|
||||||
return { ...u, username: u.name, avatar: u.avatar?.url }
|
return { ...u, username: u.name, avatar: u.avatar?.url }
|
||||||
@ -415,7 +415,7 @@ export default {
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
.then(({ data: { CreateRoom } }) => {
|
.then(({ data: { CreateRoom } }) => {
|
||||||
this.fetchRooms({ room: CreateRoom })
|
this.fetchRooms({ room: CreateRoom, options: { refetch: true } })
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
this.$toast.error(error)
|
this.$toast.error(error)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user