From 630ece82add1ed101e598ed67d3ee0938a39d7bd Mon Sep 17 00:00:00 2001 From: advplyr Date: Fri, 15 Mar 2024 14:35:09 -0500 Subject: [PATCH] Fix:Chapter modal scroll to current chapter --- client/components/modals/ChaptersModal.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) 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) + } } }