2022-03-21 05:13:21 +00:00
|
|
|
export const state = () => ({
|
2022-03-21 23:47:11 +00:00
|
|
|
roundTweak: 0,
|
2022-05-14 18:23:45 +00:00
|
|
|
roundThumb: null,
|
|
|
|
roundWatch: null,
|
2022-03-21 23:47:11 +00:00
|
|
|
});
|
2022-03-21 05:13:21 +00:00
|
|
|
export const mutations = {
|
2022-03-21 23:47:11 +00:00
|
|
|
initTweaks(state) {
|
|
|
|
// NOTE: localStorage is not reactive, so it will only be used on first load
|
2022-05-14 18:23:45 +00:00
|
|
|
// currently called on mounted() in pages/index.vue
|
2022-03-21 23:47:11 +00:00
|
|
|
if (process.client) {
|
2022-05-28 00:17:30 +00:00
|
|
|
state.roundTweak = JSON.parse(localStorage.getItem("roundTweak")) || 0;
|
2022-05-18 03:19:22 +00:00
|
|
|
state.roundThumb =
|
|
|
|
JSON.parse(localStorage.getItem("roundThumb")) === true;
|
|
|
|
state.roundWatch =
|
|
|
|
JSON.parse(localStorage.getItem("roundWatch")) === true;
|
2022-03-21 05:13:21 +00:00
|
|
|
}
|
2022-03-21 23:47:11 +00:00
|
|
|
},
|
|
|
|
setRoundTweak(state, payload) {
|
|
|
|
if (!isNaN(payload)) {
|
|
|
|
state.roundTweak = payload;
|
|
|
|
localStorage.setItem("roundTweak", payload);
|
|
|
|
}
|
|
|
|
},
|
2022-05-13 22:25:47 +00:00
|
|
|
setRoundThumb(state, payload) {
|
|
|
|
state.roundThumb = payload;
|
|
|
|
localStorage.setItem("roundThumb", payload);
|
|
|
|
},
|
|
|
|
setRoundWatch(state, payload) {
|
|
|
|
state.roundWatch = payload;
|
|
|
|
localStorage.setItem("roundWatch", payload);
|
|
|
|
},
|
2022-03-21 23:47:11 +00:00
|
|
|
};
|