Skip to content

Commit

Permalink
fix(labels): copy before priority sort
Browse files Browse the repository at this point in the history
  • Loading branch information
ssube committed Aug 28, 2020
1 parent 9e162b7 commit 20d1175
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/labels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ export function getValueName(state: StateLabel, value: StateValue): string {
* TODO: add some sort options: high-first or low-first, case-sensitivity
*/
export function prioritySort<TLabel extends BaseLabel>(labels: Array<TLabel>): Array<TLabel> {
return labels.sort((a, b) => {
return Array.from(labels).sort((a, b) => {
if (a.priority === b.priority) {
const aName = a.name.toLocaleLowerCase();
const bName = b.name.toLocaleLowerCase();
Expand Down

0 comments on commit 20d1175

Please sign in to comment.