Skip to content

Commit

Permalink
Back up learners and groups selection
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexVelezLl committed Jan 14, 2025
1 parent 288e2f5 commit e8b6ade
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,21 @@
watch: {
selectedRecipients(newVal) {
if (newVal === ClassRecipients.ENTIRE_CLASS) {
// Backup data in case user selects group or individual again.
this.selectedGroupsBackedUp = this.selectedGroupIds;
this.adHocLearnersBackedUp = this.adHocLearners;
this.selectedGroupIds = [this.classId];
this.updateAdHocLearners([]);
} else {
this.selectedGroupIds = this.selectedCollectionIds.filter(id => id !== this.classId);
if (this.adHocLearnersBackedUp) {
this.updateAdHocLearners(this.adHocLearnersBackedUp);
}
if (this.selectedGroupsBackedUp) {
this.selectedGroupIds = this.selectedGroupsBackedUp;
} else {
this.selectedGroupIds = this.selectedCollectionIds.filter(id => id !== this.classId);
}
}
},
selectedGroupIds(newVal) {
Expand Down

0 comments on commit e8b6ade

Please sign in to comment.