Fix:Chapter modal scroll to current chapter

This commit is contained in:
advplyr 2024-03-15 14:35:09 -05:00
parent 5777184cae
commit 630ece82ad

View File

@ -34,11 +34,6 @@ export default {
data() { data() {
return {} return {}
}, },
watch: {
value(newVal) {
this.$nextTick(this.scrollToChapter)
}
},
computed: { computed: {
show: { show: {
get() { get() {
@ -53,7 +48,7 @@ export default {
return this.playbackRate return this.playbackRate
}, },
currentChapterId() { currentChapterId() {
return this.currentChapter ? this.currentChapter.id : null return this.currentChapter?.id || null
}, },
currentChapterStart() { currentChapterStart() {
return (this.currentChapter?.start || 0) / this._playbackRate return (this.currentChapter?.start || 0) / this._playbackRate
@ -74,6 +69,11 @@ export default {
} }
} }
} }
},
updated() {
if (this.value) {
this.$nextTick(this.scrollToChapter)
}
} }
} }
</script> </script>