mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
removed console log and fixed reloading of messages
This commit is contained in:
parent
98cad5b568
commit
d7aba44fbe
@ -26,7 +26,6 @@ export default {
|
|||||||
subscribe: withFilter(
|
subscribe: withFilter(
|
||||||
() => pubsub.asyncIterator(CHAT_MESSAGE_ADDED),
|
() => pubsub.asyncIterator(CHAT_MESSAGE_ADDED),
|
||||||
(payload, variables) => {
|
(payload, variables) => {
|
||||||
console.log('chatMessageAdded', payload, variables)
|
|
||||||
return true // payload.user.id === variables.userId
|
return true // payload.user.id === variables.userId
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|||||||
@ -314,12 +314,13 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async chatMessageAdded({data}){
|
async chatMessageAdded({data}){
|
||||||
console.log(data)
|
|
||||||
if(data.chatMessageAdded.room.id === this.selectedRoom?.id){
|
if(data.chatMessageAdded.room.id === this.selectedRoom?.id){
|
||||||
this.fetchMessages({ room: this.selectedRoom}, { refetch: true})
|
this.fetchMessages({ room: this.selectedRoom, options: { refetch: true }})
|
||||||
} else {
|
} else {
|
||||||
// TODO this might be optimized selectively (first page vs rest)
|
// TODO this might be optimized selectively (first page vs rest)
|
||||||
this.rooms = []
|
this.rooms = []
|
||||||
|
this.roomPage = 0
|
||||||
|
this.roomsLoaded = false
|
||||||
this.fetchRooms()
|
this.fetchRooms()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user