mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
user mapgetters instead of addressing the store directly
This commit is contained in:
parent
0888be0f70
commit
cb8db68b5b
@ -3,7 +3,7 @@
|
|||||||
<client-only>
|
<client-only>
|
||||||
<vue-advanced-chat
|
<vue-advanced-chat
|
||||||
:theme="theme"
|
:theme="theme"
|
||||||
:current-user-id="currentUserId"
|
:current-user-id="currentUser.id"
|
||||||
:room-id="null"
|
:room-id="null"
|
||||||
:template-actions="JSON.stringify(templatesText)"
|
:template-actions="JSON.stringify(templatesText)"
|
||||||
:menu-actions="JSON.stringify(menuActions)"
|
:menu-actions="JSON.stringify(menuActions)"
|
||||||
@ -29,6 +29,7 @@
|
|||||||
<script>
|
<script>
|
||||||
import { roomQuery, createRoom } from '~/graphql/Rooms'
|
import { roomQuery, createRoom } from '~/graphql/Rooms'
|
||||||
import { messageQuery, createMessageMutation } from '~/graphql/Messages'
|
import { messageQuery, createMessageMutation } from '~/graphql/Messages'
|
||||||
|
import { mapGetters } from 'vuex'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'Chat',
|
name: 'Chat',
|
||||||
@ -43,7 +44,6 @@ export default {
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
currentUserId: this.$store.getters['auth/user'].id,
|
|
||||||
menuActions: [
|
menuActions: [
|
||||||
/* {
|
/* {
|
||||||
name: 'inviteUser',
|
name: 'inviteUser',
|
||||||
@ -131,6 +131,11 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
...mapGetters({
|
||||||
|
currentUser: 'auth/user',
|
||||||
|
}),
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchMessages({ room, options = {} }) {
|
fetchMessages({ room, options = {} }) {
|
||||||
this.messagesLoaded = false
|
this.messagesLoaded = false
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user