Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Julien Veyssier
funkwhale
Commits
e319f593
Verified
Commit
e319f593
authored
Mar 02, 2018
by
Eliot Berriot
Browse files
Store for instance events
parent
40350f05
Changes
2
Hide whitespace changes
Inline
Side-by-side
front/src/store/index.js
View file @
e319f593
...
...
@@ -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
'
],
...
...
front/src/store/instance.js
View file @
e319f593
...
...
@@ -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
:
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment