TIANYONG 11 ماه پیش
والد
کامیت
1845af2a2e
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      src/state.ts

+ 1 - 1
src/state.ts

@@ -1858,7 +1858,7 @@ export const fillWordColor = () => {
       if (state.times[state.activeNoteIndex].noteElement?.length?.realValue === 0.5) {
         const si = state.times[state.activeNoteIndex].si || 0;
         const halfNotes = state.times[state.activeNoteIndex].measures.filter((item: any) => item?.noteElement?.length?.realValue === 0.5) || [];
-        const sIdx = halfNotes.findIndex((item: any) => item.noteElement === state.times[state.activeNoteIndex].noteElement);
+        const sIdx = halfNotes?.findIndex((item: any) => item?.noteElement === state.times[state.activeNoteIndex]?.noteElement);
         const filterRects = svgEl?.parentElement?.querySelectorAll('rect')?.length ? Array.from(svgEl?.parentElement?.querySelectorAll('rect')).filter(item => item.parentElement === svgEl?.parentElement) : [];
         filterRects?.[sIdx]?.classList.add('rectActive');
       } else {