mirror of
https://github.com/VueTubeApp/VueTube
synced 2024-11-20 02:05:15 +00:00
18 lines
504 B
JavaScript
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);
|
|
}
|
|
},
|
|
};
|