Verified Commit b6ecc511 authored by Eliot Berriot's avatar Eliot Berriot
Browse files

Cache filters

parent 3ccccd15
......@@ -86,12 +86,15 @@
import sources from '@/sources'
import config from '@/config'
import orderBy from 'lodash/orderBy'
import defaults from 'lodash/defaults'
import pull from 'lodash/pull'
import chunk from 'lodash/chunk'
import axios from 'axios'
export default {
data () {
let filters = this.$store.state.cache.suggestionFilters || {}
filters = defaults(filters, {providers: [], retributeOnly: null})
return {
sources: sources.sources,
maxDays: 60,
......@@ -101,10 +104,7 @@ export default {
aggregatedSuggestions: this.$store.state.cache.aggregatedSuggestions || {},
retributeProfiles: this.$store.state.cache.retributeProfiles || {},
loadingRetributeProfiles: [],
filters: {
retributeOnly: null,
providers: [],
},
filters: filters,
providers: this.$store.state.cache.providers || []
}
},
......@@ -295,6 +295,12 @@ export default {
},
deep: true
},
"filters": {
handler (v) {
this.$store.commit('setRecursiveState', {key: 'cache.suggestionFilters', value: this.filters})
},
deep: true
},
providers: {
handler (v) {
this.$store.commit('setRecursiveState', {key: 'cache.providers', value: this.providers})
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment