浏览代码

fix: 选段bug修复

TIANYONG 1 年之前
父节点
当前提交
b5a9c57f02
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      src/state.ts

+ 1 - 1
src/state.ts

@@ -562,7 +562,7 @@ export const setSection = (start: number, end: number, userSpeed?: number) => {
     lastEndNotes = newEndNotes.filter((n: any) => n.noteId === newLastEndId)
     lastEndNotes = newEndNotes.filter((n: any) => n.noteId === newLastEndId)
   }
   }
 
 
-  const endIdx: any = (isCanRepeat && canRepeatInfo.repeatIdx == state.repeatInfo.length - 1) ? 1 : 0
+  const endIdx: any = (isCanRepeat && canRepeatInfo.repeatIdx == state.repeatInfo.length - 1) ? lastEndNotes.length - 1 : 0
   const startNote = startNotes[0]
   const startNote = startNotes[0]
   // const endNote = endNotes[endNotes.length - 1]
   // const endNote = endNotes[endNotes.length - 1]
   const endNote = lastEndNotes[endIdx]			
   const endNote = lastEndNotes[endIdx]