Skip to content

Commit cb0b46b

Browse files
authored
Merge pull request #13879 from nucleogenesis/fix-coach-copying-counts
Fix CopyClassModal handle removed coaches
2 parents 5d36112 + 3a014f2 commit cb0b46b

File tree

1 file changed

+7
-0
lines changed
  • kolibri/plugins/facility/assets/src/modules/classEditManagement

1 file changed

+7
-0
lines changed

kolibri/plugins/facility/assets/src/modules/classEditManagement/index.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,13 @@ export default {
4141
},
4242
DELETE_CLASS_COACH(state, id) {
4343
state.classCoaches = state.classCoaches.filter(user => user.id !== id);
44+
// Note that we only do this here because we use `currentClass.coaches` when relevant,
45+
// but there is no equivalent `currentClass.learners` - instead code uses `classLearners`
46+
// where relevant. This is a bit of a stop-gap before this is converted away from Vuex
47+
// in the near future.
48+
if (state.currentClass) {
49+
state.currentClass.coaches = state.currentClass.coaches.filter(u => u.id !== id);
50+
}
4451
},
4552
},
4653
actions: {

0 commit comments

Comments
 (0)