Move shout module to store

This commit is contained in:
Sean King 2023-04-04 21:17:54 -06:00
commit aa6c13f9e6
No known key found for this signature in database
GPG key ID: 510C52BACD6E7257
8 changed files with 50 additions and 61 deletions

View file

@ -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 () {

View file

@ -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)
},