0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-12-01 15:37:29 +00:00
VueTube/NUXT/store/index.js

26 lines
693 B
JavaScript
Raw Normal View History

2022-03-24 04:28:57 +00:00
import Vue from "vue";
export const state = () => ({
recommendedVideos: [],
watchTelemetry: null,
2022-03-24 04:28:57 +00:00
});
export const mutations = {
initTelemetryPreference(state) {
if (process.client) {
state.watchTelemetry = !(
// false if false, defaults to true
(JSON.parse(localStorage.getItem("watchTelemetry")) === false)
);
// JSON.parse(localStorage.getItem("watchTelemetry")) === true; // defaults to false
}
},
setTelemetryPreference(state, payload) {
state.watchTelemetry = payload;
localStorage.setItem("watchTelemetry", payload);
},
2022-03-24 04:28:57 +00:00
updateRecommendedVideos(state, payload) {
Vue.set(state, "recommendedVideos", payload);
},
};