Files
vuefilemanager/resources/js/store/modules/broadcasting.js
2022-03-10 11:49:02 +01:00

34 lines
614 B
JavaScript
Vendored

const defaultState = {
isRunningConnection: false,
}
const actions = {
runConnection: ({ commit, getters, dispatch }) => {
commit('SET_RUNNING_COMMUNICATION')
Echo.private(`App.Users.Models.User.${getters.user.data.id}`)
.notification(() => {
// TODO: call sound
dispatch('getAppData')
});
},
}
const mutations = {
SET_RUNNING_COMMUNICATION(state) {
state.isRunningConnection = true
},
}
const getters = {
isRunningConnection: (state) => state.isRunningConnection,
}
export default {
state: defaultState,
getters,
actions,
mutations,
}