Skip to content

Commit db7edb0

Browse files
committed
optimize support staff filtering using Set
1 parent 5e175f9 commit db7edb0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

app/supportCallResponseReport/supportCallResponseReportCtrl.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ class SupportCallResponseReportCtrl {
4747
}
4848
));
4949

50-
const currentSupportStaffIds = _self.$scope.view.state.supportCallResponses.map(response => response.supportStaffId);
51-
const currentSupportStaff = _self.$scope.view.state.supportStaff.filter(supportStaff => currentSupportStaffIds.includes(supportStaff.id));
50+
const currentSupportStaffIds = new Set(_self.$scope.view.state.supportCallResponses.map(response => response.supportStaffId));
51+
const currentSupportStaff = _self.$scope.view.state.supportStaff.filter(supportStaff => currentSupportStaffIds.has(supportStaff.id));
5252
if (_self.$scope.view.state.ui.showSubmitted === true) {
5353
_self.$scope.filteredSupportStaff = currentSupportStaff.filter(staff => {
5454
return staff.preferences.length > 0;

0 commit comments

Comments
 (0)