Chatwoot/app/javascript/widget/store/modules/events.js
Santhosh C 6cfd7d3836
feat: autogenerate vapid keys for push notifications (#3128)
* feat: Autogenerate push notification keys
* add vapid service class and remove pushkey model
* add spec for vapid service
* unset vapid env keys
* Unset VAPID_PRIVATE_KEY env variable

Co-authored-by: Sojan Jose <sojan@chatwoot.com>
Co-authored-by: Vishnu Narayanan <vishnu@chatwoot.com>
2021-11-09 21:36:32 +05:30

29 lines
409 B
JavaScript

import events from 'widget/api/events';
const state = {
isOpen: false,
};
const actions = {
create: async (_, { name }) => {
try {
await events.create(name);
} catch (error) {
// Ignore error
}
},
};
const mutations = {
toggleOpen($state) {
$state.isOpen = !$state.isOpen;
},
};
export default {
namespaced: true,
state,
getters: {},
actions,
mutations,
};