소스 검색

资源加载提示修改

黄琪勇 1 년 전
부모
커밋
355bfc1339
2개의 변경된 파일2개의 추가작업 그리고 2개의 파일을 삭제
  1. 1 1
      src/page-instrument/header-top/index.tsx
  2. 1 1
      src/state.ts

+ 1 - 1
src/page-instrument/header-top/index.tsx

@@ -53,7 +53,7 @@ export const headTopData = reactive({
       // 如果延迟检测资源还在加载中,给出提示
       if (!evaluatingData.jsonLoadDone) {
         evaluatingData.jsonLoading = true;
-        showToast("资源加载中,请稍后");
+        state.audioDone && showToast("资源加载中,请稍后");  //音频资源加载完之后才提示
         return;
       }
 

+ 1 - 1
src/state.ts

@@ -679,7 +679,7 @@ watch(()=>state.playState,()=>{
 export const togglePlay = async (playState?: "play" | "paused", sourceType?: string) => {
   // 如果mp3资源还在加载中,给出提示
   if (!state.isAppPlay && !state.audioDone) {
-    //if (sourceType !== 'courseware') showToast('音频资源加载中,请稍后')
+    if (sourceType !== 'courseware') showToast('音频资源加载中,请稍后')
     return
   }
   // 播放之前  当为评测模式和不为MIDI时候按  是否禁用节拍器  切换音源