0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-28 22:23:04 +00:00
VueTube/NUXT/store/index.js
2022-12-26 03:25:17 -05:00

25 lines
693 B
JavaScript

import Vue from "vue";
export const state = () => ({
recommendedVideos: [],
watchTelemetry: null,
});
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);
},
updateRecommendedVideos(state, payload) {
Vue.set(state, "recommendedVideos", payload);
},
};