0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-20 02:05:15 +00:00
VueTube/NUXT/store/tweaks/index.js
2022-03-21 19:47:11 -04:00

18 lines
504 B
JavaScript

export const state = () => ({
roundTweak: 0,
});
export const mutations = {
initTweaks(state) {
// NOTE: localStorage is not reactive, so it will only be used on first load
// currently called beforeCreate() in pages/default.vue
if (process.client) {
state.roundTweak = localStorage.getItem("roundTweak") || 0;
}
},
setRoundTweak(state, payload) {
if (!isNaN(payload)) {
state.roundTweak = payload;
localStorage.setItem("roundTweak", payload);
}
},
};