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:
parent
c0dde9a32d
commit
d358d74bc4
1 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue