fix:pressing of "Tab" at the end of article practice causes an error

This commit is contained in:
zyronon
2025-09-17 00:54:58 +08:00
parent cb88ed9468
commit 3e68e328f8
2 changed files with 6 additions and 4 deletions

View File

@@ -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

View File

@@ -165,7 +165,7 @@ function checkTranslateLocation() {
let lockNextSentence = false
function nextSentence() {
if (lockNextSentence) return
if (lockNextSentence || isEnd) return
checkTranslateLocation()
lockNextSentence = true
// wordData.words = [