From 62dda2642d9cbd5ed413a9b93bed085dcd0f0d87 Mon Sep 17 00:00:00 2001 From: Tachibana Shin <45375496+tachibana-shin@users.noreply.github.com> Date: Sat, 15 Oct 2022 10:10:18 +0700 Subject: [PATCH] fix restore view progress of next chap --- src/components/BrtPlayer.vue | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/BrtPlayer.vue b/src/components/BrtPlayer.vue index 533611df..66caced9 100644 --- a/src/components/BrtPlayer.vue +++ b/src/components/BrtPlayer.vue @@ -803,10 +803,12 @@ const setArtCurrentTime = (currentTime: number) => { video.value.currentTime = currentTime artCurrentTime.value = currentTime } +let disableBackupProgressViewing = false watch( () => props.currentChap, async (currentChap) => { if (currentChap) { + disableBackupProgressViewing = true setArtCurrentTime(0) if (!authStore.user_data) return @@ -824,6 +826,7 @@ watch( setArtCurrentTime(cur) addNotice(`Đã khôi phục phiên xem trước ${parseTime(cur)}`) } + disableBackupProgressViewing = false } }, { immediate: true } @@ -976,6 +979,8 @@ const emit = defineEmits<{ }>() const saveCurTimeToPer = throttle(async () => { if (!seasonRefCache) return + + if (disableBackupProgressViewing) return // eslint-disable-next-line @typescript-eslint/no-non-null-assertion const chapRef = doc(seasonRefCache, "chaps", props.currentChap!)