From 73f64392a953300f7320986e870cd968dcf1ab69 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Sat, 3 Aug 2024 22:30:47 +0900 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E3=82=BD=E3=83=AD=E5=85=A8=E8=A7=A3?= =?UTF-8?q?=E9=99=A4=E3=82=92=E3=81=97=E3=81=A6=E5=86=8D=E7=94=9F=E3=81=99?= =?UTF-8?q?=E3=82=8B=E3=81=A8=E3=80=81=E5=85=A8=E8=A7=A3=E9=99=A4=E5=89=8D?= =?UTF-8?q?=E3=81=AE=E3=82=88=E3=81=86=E3=81=AB=E8=81=9E=E3=81=93=E3=81=88?= =?UTF-8?q?=E3=82=8B=E3=83=90=E3=82=B0=E3=81=AE=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/singing.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/store/singing.ts b/src/store/singing.ts index 187620a989..28354a0017 100644 --- a/src/store/singing.ts +++ b/src/store/singing.ts @@ -2365,8 +2365,10 @@ export const singingStore = createPartialStore({ track.solo = false; } }, - action({ commit }) { + action({ commit, dispatch }) { commit("UNSOLO_ALL_TRACKS"); + + dispatch("RENDER"); }, }, @@ -2503,11 +2505,13 @@ export const singingCommandStore = transformCommandStore( singingStore.mutations.SET_TIME_SIGNATURE(draft, { timeSignature }); }, // 拍子を設定する。既に同じ位置に拍子が存在する場合は置き換える。 - action({ commit }, { timeSignature }: { timeSignature: TimeSignature }) { + action({ commit, dispatch }, { timeSignature }) { if (!isValidTimeSignature(timeSignature)) { throw new Error("The time signature is invalid."); } commit("COMMAND_SET_TIME_SIGNATURE", { timeSignature }); + + dispatch("RENDER"); }, }, COMMAND_REMOVE_TIME_SIGNATURE: { @@ -2515,7 +2519,7 @@ export const singingCommandStore = transformCommandStore( singingStore.mutations.REMOVE_TIME_SIGNATURE(draft, { measureNumber }); }, // 拍子を削除する。先頭の拍子の場合はデフォルトの拍子に置き換える。 - action({ state, commit }, { measureNumber }: { measureNumber: number }) { + action({ state, commit, dispatch }, { measureNumber }) { const exists = state.timeSignatures.some((value) => { return value.measureNumber === measureNumber; }); @@ -2523,6 +2527,8 @@ export const singingCommandStore = transformCommandStore( throw new Error("The time signature does not exist."); } commit("COMMAND_REMOVE_TIME_SIGNATURE", { measureNumber }); + + dispatch("RENDER"); }, }, COMMAND_ADD_NOTES: { @@ -2738,8 +2744,10 @@ export const singingCommandStore = transformCommandStore( mutation(draft) { singingStore.mutations.UNSOLO_ALL_TRACKS(draft, undefined); }, - action({ commit }) { + action({ commit, dispatch }) { commit("COMMAND_UNSOLO_ALL_TRACKS"); + + dispatch("RENDER"); }, }, From 13f3f7df9342748e0b929c61676c3aa0f84173d0 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Sun, 4 Aug 2024 01:41:18 +0900 Subject: [PATCH 2/3] =?UTF-8?q?TIME=5FSIGNATURE=E7=B3=BB=E7=B5=B1=E3=81=AB?= =?UTF-8?q?RENDER=E3=81=AF=E8=A6=81=E3=82=89=E3=81=AA=E3=81=84=E3=81=AF?= =?UTF-8?q?=E3=81=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/singing.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/store/singing.ts b/src/store/singing.ts index 28354a0017..960be63189 100644 --- a/src/store/singing.ts +++ b/src/store/singing.ts @@ -520,15 +520,13 @@ export const singingStore = createPartialStore({ state.timeSignatures = timeSignatures; }, async action( - { commit, dispatch }, + { commit }, { timeSignatures }: { timeSignatures: TimeSignature[] }, ) { if (!isValidTimeSignatures(timeSignatures)) { throw new Error("The time signatures are invalid."); } commit("SET_TIME_SIGNATURES", { timeSignatures }); - - dispatch("RENDER"); }, }, @@ -2505,13 +2503,11 @@ export const singingCommandStore = transformCommandStore( singingStore.mutations.SET_TIME_SIGNATURE(draft, { timeSignature }); }, // 拍子を設定する。既に同じ位置に拍子が存在する場合は置き換える。 - action({ commit, dispatch }, { timeSignature }) { + action({ commit }, { timeSignature }) { if (!isValidTimeSignature(timeSignature)) { throw new Error("The time signature is invalid."); } commit("COMMAND_SET_TIME_SIGNATURE", { timeSignature }); - - dispatch("RENDER"); }, }, COMMAND_REMOVE_TIME_SIGNATURE: { @@ -2519,7 +2515,7 @@ export const singingCommandStore = transformCommandStore( singingStore.mutations.REMOVE_TIME_SIGNATURE(draft, { measureNumber }); }, // 拍子を削除する。先頭の拍子の場合はデフォルトの拍子に置き換える。 - action({ state, commit, dispatch }, { measureNumber }) { + action({ state, commit }, { measureNumber }) { const exists = state.timeSignatures.some((value) => { return value.measureNumber === measureNumber; }); @@ -2527,8 +2523,6 @@ export const singingCommandStore = transformCommandStore( throw new Error("The time signature does not exist."); } commit("COMMAND_REMOVE_TIME_SIGNATURE", { measureNumber }); - - dispatch("RENDER"); }, }, COMMAND_ADD_NOTES: { From b53f24002e71468c19d20741e9ed4c5c171469d8 Mon Sep 17 00:00:00 2001 From: Hiroshiba Date: Sun, 4 Aug 2024 01:43:05 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E4=B8=8D=E8=A6=81=E3=81=AA=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=AA=E3=81=AE=E3=81=A7=E6=88=BB=E3=81=97=E3=81=A6?= =?UTF-8?q?=E3=81=8A=E3=81=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/store/singing.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/store/singing.ts b/src/store/singing.ts index 960be63189..1dd3082d8a 100644 --- a/src/store/singing.ts +++ b/src/store/singing.ts @@ -2503,7 +2503,7 @@ export const singingCommandStore = transformCommandStore( singingStore.mutations.SET_TIME_SIGNATURE(draft, { timeSignature }); }, // 拍子を設定する。既に同じ位置に拍子が存在する場合は置き換える。 - action({ commit }, { timeSignature }) { + action({ commit }, { timeSignature }: { timeSignature: TimeSignature }) { if (!isValidTimeSignature(timeSignature)) { throw new Error("The time signature is invalid."); } @@ -2515,7 +2515,7 @@ export const singingCommandStore = transformCommandStore( singingStore.mutations.REMOVE_TIME_SIGNATURE(draft, { measureNumber }); }, // 拍子を削除する。先頭の拍子の場合はデフォルトの拍子に置き換える。 - action({ state, commit }, { measureNumber }) { + action({ state, commit }, { measureNumber }: { measureNumber: number }) { const exists = state.timeSignatures.some((value) => { return value.measureNumber === measureNumber; });