Moving settings to be user specific, adding playbackRate setting, update playbackRate picker to go up to 3x

This commit is contained in:
advplyr
2021-08-23 18:31:04 -05:00
parent 40502aab1e
commit 7ef977b783
22 changed files with 247 additions and 103 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ export default {
},
computed: {
user() {
return this.$store.state.user || null
return this.$store.state.user.user || null
},
username() {
return this.user.username
+1 -1
View File
@@ -66,7 +66,7 @@ export default {
draggable
},
async asyncData({ store, params, app, redirect, route }) {
if (!store.state.user) {
if (!store.state.user.user) {
return redirect(`/login?redirect=${route.path}`)
}
var audiobook = await app.$axios.$get(`/api/audiobook/${params.id}`).catch((error) => {
+2 -2
View File
@@ -63,7 +63,7 @@
<script>
export default {
async asyncData({ store, params, app, redirect, route }) {
if (!store.state.user) {
if (!store.state.user.user) {
return redirect(`/login?redirect=${route.path}`)
}
var audiobook = await app.$axios.$get(`/api/audiobook/${params.id}`).catch((error) => {
@@ -163,7 +163,7 @@ export default {
return this.book.description || 'No Description'
},
userAudiobooks() {
return this.$store.state.user ? this.$store.state.user.audiobooks || {} : {}
return this.$store.state.user.user ? this.$store.state.user.user.audiobooks || {} : {}
},
userAudiobook() {
return this.userAudiobooks[this.audiobookId] || null
+3 -3
View File
@@ -49,7 +49,7 @@ export default {
},
computed: {
user() {
return this.$store.state.user
return this.$store.state.user.user
}
},
methods: {
@@ -71,7 +71,7 @@ export default {
} else if (authRes.error) {
this.error = authRes.error
} else {
this.$store.commit('setUser', authRes.user)
this.$store.commit('user/setUser', authRes.user)
}
this.processing = false
},
@@ -90,7 +90,7 @@ export default {
}
})
.then((res) => {
this.$store.commit('setUser', res.user)
this.$store.commit('user/setUser', res.user)
this.processing = false
})
.catch((error) => {