Skip to content

Commit

Permalink
slight optimization when options order isn't recognized
Browse files Browse the repository at this point in the history
  • Loading branch information
oshi97 committed Oct 12, 2021
1 parent 25ba9b4 commit 04d4737
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion static/js/transform-facets.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,11 @@ function sortFacetOptions(options, optionsOrder, fieldId) {
return undefined;
}
}
return [...options].sort(getSortComparator())
const comparator = getSortComparator();
if (!comparator) {
return options;
}
return [...options].sort(comparator);
}


Expand Down

0 comments on commit 04d4737

Please sign in to comment.