removed console log and fixed reloading of messages

This commit is contained in:
Ulf Gebhardt 2023-07-18 10:48:42 +02:00
parent 98cad5b568
commit d7aba44fbe
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
2 changed files with 3 additions and 3 deletions

View File

@ -26,7 +26,6 @@ export default {
subscribe: withFilter(
() => pubsub.asyncIterator(CHAT_MESSAGE_ADDED),
(payload, variables) => {
console.log('chatMessageAdded', payload, variables)
return true // payload.user.id === variables.userId
},
),

View File

@ -314,12 +314,13 @@ export default {
},
async chatMessageAdded({data}){
console.log(data)
if(data.chatMessageAdded.room.id === this.selectedRoom?.id){
this.fetchMessages({ room: this.selectedRoom}, { refetch: true})
this.fetchMessages({ room: this.selectedRoom, options: { refetch: true }})
} else {
// TODO this might be optimized selectively (first page vs rest)
this.rooms = []
this.roomPage = 0
this.roomsLoaded = false
this.fetchRooms()
}
},