mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
linting
This commit is contained in:
parent
ae2d6c7ad5
commit
33ecc4764e
@ -61,7 +61,12 @@
|
||||
|
||||
<script>
|
||||
import { roomQuery, createRoom, unreadRoomsQuery } from '~/graphql/Rooms'
|
||||
import { messageQuery, createMessageMutation, chatMessageAdded, markMessagesAsSeen } from '~/graphql/Messages'
|
||||
import {
|
||||
messageQuery,
|
||||
createMessageMutation,
|
||||
chatMessageAdded,
|
||||
markMessagesAsSeen,
|
||||
} from '~/graphql/Messages'
|
||||
import chatStyle from '~/constants/chat.js'
|
||||
import { mapGetters, mapMutations } from 'vuex'
|
||||
|
||||
@ -180,11 +185,10 @@ export default {
|
||||
|
||||
observer.subscribe({
|
||||
next: this.chatMessageAdded,
|
||||
error (error) {
|
||||
console.error(error)
|
||||
error(error) {
|
||||
this.$toast.error(error)
|
||||
},
|
||||
})
|
||||
|
||||
},
|
||||
computed: {
|
||||
...mapGetters({
|
||||
@ -313,9 +317,9 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
async chatMessageAdded({data}){
|
||||
if(data.chatMessageAdded.room.id === this.selectedRoom?.id){
|
||||
this.fetchMessages({ room: this.selectedRoom, options: { refetch: true }})
|
||||
async chatMessageAdded({ data }) {
|
||||
if (data.chatMessageAdded.room.id === this.selectedRoom?.id) {
|
||||
this.fetchMessages({ room: this.selectedRoom, options: { refetch: true } })
|
||||
} else {
|
||||
// TODO this might be optimized selectively (first page vs rest)
|
||||
this.rooms = []
|
||||
|
||||
@ -37,7 +37,7 @@ export const createMessageMutation = () => {
|
||||
export const chatMessageAdded = () => {
|
||||
return gql`
|
||||
subscription chatMessageAdded($userId: ID!) {
|
||||
chatMessageAdded(userId: $userId){
|
||||
chatMessageAdded(userId: $userId) {
|
||||
#_id
|
||||
id
|
||||
# indexId
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user