Skip to content
Snippets Groups Projects
Verified Commit e319f593 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Store for instance events

parent 40350f05
No related branches found
No related tags found
No related merge requests found
......@@ -30,6 +30,10 @@ export default new Vuex.Store({
return mutation.type.startsWith('auth/')
}
}),
createPersistedState({
key: 'instance',
paths: ['instance.events']
}),
createPersistedState({
key: 'radios',
paths: ['radios'],
......
......@@ -5,6 +5,8 @@ import _ from 'lodash'
export default {
namespaced: true,
state: {
maxEvents: 200,
events: [],
settings: {
instance: {
name: {
......@@ -35,6 +37,12 @@ export default {
mutations: {
settings: (state, value) => {
_.merge(state.settings, value)
},
event: (state, value) => {
state.events.unshift(value)
if (state.events.length > state.maxEvents) {
state.events = state.events.slice(0, state.maxEvents)
}
}
},
actions: {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment