Move shout module to store
This commit is contained in:
parent
aa98e83ff0
commit
aa6c13f9e6
8 changed files with 50 additions and 61 deletions
|
|
@ -4,6 +4,7 @@ import {
|
|||
faBullhorn,
|
||||
faTimes
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import { useShoutStore } from '../../stores/shout'
|
||||
|
||||
library.add(
|
||||
faBullhorn,
|
||||
|
|
@ -21,12 +22,12 @@ const shoutPanel = {
|
|||
},
|
||||
computed: {
|
||||
messages () {
|
||||
return this.$store.state.shout.messages
|
||||
return useShoutStore().messages
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit (message) {
|
||||
this.$store.state.shout.channel.push('new_msg', { text: message }, 10000)
|
||||
useShoutStore().channel.push('new_msg', { text: message }, 10000)
|
||||
this.currentMessage = ''
|
||||
},
|
||||
togglePanel () {
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import {
|
|||
faCompass,
|
||||
faList
|
||||
} from '@fortawesome/free-solid-svg-icons'
|
||||
import { useShoutStore } from '../../stores/shout'
|
||||
|
||||
library.add(
|
||||
faSignInAlt,
|
||||
|
|
@ -54,7 +55,7 @@ const SideDrawer = {
|
|||
currentUser () {
|
||||
return this.$store.state.users.currentUser
|
||||
},
|
||||
shout () { return this.$store.state.shout.joined },
|
||||
shout () { return useShoutStore().joined },
|
||||
unseenNotifications () {
|
||||
return unseenNotificationsFromStore(this.$store)
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue