diff --git a/client/components/modals/ChaptersModal.vue b/client/components/modals/ChaptersModal.vue index 2ace9891..4c005639 100644 --- a/client/components/modals/ChaptersModal.vue +++ b/client/components/modals/ChaptersModal.vue @@ -34,11 +34,6 @@ export default { data() { return {} }, - watch: { - value(newVal) { - this.$nextTick(this.scrollToChapter) - } - }, computed: { show: { get() { @@ -53,7 +48,7 @@ export default { return this.playbackRate }, currentChapterId() { - return this.currentChapter ? this.currentChapter.id : null + return this.currentChapter?.id || null }, currentChapterStart() { return (this.currentChapter?.start || 0) / this._playbackRate @@ -74,6 +69,11 @@ export default { } } } + }, + updated() { + if (this.value) { + this.$nextTick(this.scrollToChapter) + } } }