traxxx/assets/js/ui/actions.js

37 lines
839 B
JavaScript

function initUiActions(_store, _router) {
function setFilter({ commit }, filter) {
commit('setFilter', filter);
localStorage.setItem('filter', filter);
}
function setRange({ commit }, range) {
commit('setRange', range);
localStorage.setItem('range', range);
}
function setBatch({ commit }, batch) {
commit('setBatch', batch);
localStorage.setItem('batch', batch);
}
function setTheme({ commit }, theme) {
commit('setTheme', theme);
localStorage.setItem('theme', theme);
}
async function setSfw({ commit }, sfw) {
commit('setSfw', sfw);
localStorage.setItem('sfw', sfw);
}
return {
setFilter,
setRange,
setBatch,
setSfw,
setTheme,
};
}
export default initUiActions;