Browse Source

Merge branch 'feature-tianyong'

TIANYONG 1 year ago
parent
commit
cd05a62f99
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/state.ts

+ 3 - 0
src/state.ts

@@ -309,6 +309,9 @@ export const skipNotePlay = (itemIndex: number, isStart = false) => {
  */
 export const togglePlay = async (playState?: "play" | "paused") => {
   state.playState = playState ? playState : state.playState === "paused" ? "play" : "paused";
+  if (state.playState === "play" && state.sectionStatus && state.section.length == 2 && state.playProgress === 0) {
+    resetPlaybackToStart();
+  }
   // 设置为开始播放时, 如果需要节拍,先播放节拍器
   if (state.playState === "play" && state.needTick) {
     const tickend = await handleStartTick();