diff --git a/src/store/modules/trainingNew.js b/src/store/modules/trainingNew.js index 482c750f1..8a558a949 100644 --- a/src/store/modules/trainingNew.js +++ b/src/store/modules/trainingNew.js @@ -78,7 +78,9 @@ const training = { Handler.judgeIsTextSendOperation(); }, clearStepInfo: (state, stepInfo) => { - state.stepInfo = {}; + if (state.stepInfo.id == stepInfo.stepId) { + state.stepInfo = {}; + } }, clearTrainingData: (state) => { state.teachMode = ''; @@ -164,8 +166,8 @@ const training = { setStepInfo: ({ commit }, stepInfo) => { commit('setStepInfo', stepInfo); }, - clearStepInfo: ({ commit }) => { - commit('clearStepInfo'); + clearStepInfo: ({ commit }, stepInfo) => { + commit('clearStepInfo', stepInfo); }, clearTrainingData: ({ commit }) => { commit('clearTrainingData'); diff --git a/src/utils/subscribeCallback.js b/src/utils/subscribeCallback.js index 9e3065c40..ff573dc64 100644 --- a/src/utils/subscribeCallback.js +++ b/src/utils/subscribeCallback.js @@ -181,7 +181,7 @@ function handle(data) { store.dispatch('trainingNew/setStepInfo', msg); break; case 'Simulation_Training_Step_Finish': - store.dispatch('trainingNew/clearStepInfo'); + store.dispatch('trainingNew/clearStepInfo', msg); break; case 'Simulation_Training_Audio_MATCH_RESULT': store.dispatch('trainingNew/handleMatchVoice', msg);