0
0
Fork 0
mirror of https://github.com/VueTubeApp/VueTube synced 2024-11-22 03:05:15 +00:00

fix: Fixed crash on launch, when item "loop" can`t be found

This commit is contained in:
Georgiy 2023-05-08 13:33:55 +03:00
parent c0dde9a32d
commit d358d74bc4

View file

@ -14,7 +14,10 @@ export const state = () => ({
export const mutations = {
initPlayer(state) {
if (process.client) {
state.loop = JSON.parse(localStorage.getItem("loop")) === true; // defaults to false
state.loop =
localStorage.getItem("loop") !== "undefined"
? JSON.parse(localStorage.getItem("loop"))
: true; // defaults to false
state.speed = JSON.parse(localStorage.getItem("speed")) || 1; // defaults to 1
state.speedAutosave = !(
// false if false, defaults to true