From 3e68e328f8b9857ddd7fe0ce6ab6e563d553925b Mon Sep 17 00:00:00 2001 From: zyronon Date: Wed, 17 Sep 2025 00:54:58 +0800 Subject: [PATCH] fix:pressing of "Tab" at the end of article practice causes an error --- src/pages/pc/article/components/ArticleAudio.vue | 8 +++++--- src/pages/pc/article/components/TypingArticle.vue | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/pages/pc/article/components/ArticleAudio.vue b/src/pages/pc/article/components/ArticleAudio.vue index e6658a25..94027cef 100644 --- a/src/pages/pc/article/components/ArticleAudio.vue +++ b/src/pages/pc/article/components/ArticleAudio.vue @@ -15,9 +15,11 @@ let instance = $ref<{ audioRef: HTMLAudioElement }>({audioRef: null}) watch(() => props.article.audioFileId, async () => { if (!props.article.audioSrc && props.article.audioFileId) { let list = await get(LOCAL_FILE_KEY) - let rItem = list.find((file) => file.id === props.article.audioFileId) - if (rItem) { - file = URL.createObjectURL(rItem.file) + if (list) { + let rItem = list.find((file) => file.id === props.article.audioFileId) + if (rItem) { + file = URL.createObjectURL(rItem.file) + } } }else { file = null diff --git a/src/pages/pc/article/components/TypingArticle.vue b/src/pages/pc/article/components/TypingArticle.vue index b7beabc6..20c52e47 100644 --- a/src/pages/pc/article/components/TypingArticle.vue +++ b/src/pages/pc/article/components/TypingArticle.vue @@ -165,7 +165,7 @@ function checkTranslateLocation() { let lockNextSentence = false function nextSentence() { - if (lockNextSentence) return + if (lockNextSentence || isEnd) return checkTranslateLocation() lockNextSentence = true // wordData.words = [