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