mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
unread rooms query in chat notification
This commit is contained in:
parent
d7746e5904
commit
c46d0064fc
@ -8,18 +8,34 @@
|
||||
placement: 'bottom-start',
|
||||
}"
|
||||
>
|
||||
<counter-icon icon="chat-bubble" :count="1" danger />
|
||||
<counter-icon icon="chat-bubble" :count="count" danger />
|
||||
</base-button>
|
||||
</nuxt-link>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CounterIcon from '~/components/_new/generic/CounterIcon/CounterIcon'
|
||||
import { unreadRoomsQuery } from '~/graphql/Rooms'
|
||||
|
||||
export default {
|
||||
name: 'ChatNotificationMenu',
|
||||
components: {
|
||||
CounterIcon,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
count: 0,
|
||||
}
|
||||
},
|
||||
apollo: {
|
||||
UnreadRooms: {
|
||||
query() {
|
||||
return unreadRoomsQuery()
|
||||
},
|
||||
update({ UnreadRooms }) {
|
||||
this.count = UnreadRooms
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
@ -27,3 +27,11 @@ export const createRoom = () => gql`
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const unreadRoomsQuery = () => {
|
||||
return gql`
|
||||
query {
|
||||
UnreadRooms
|
||||
}
|
||||
`
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user