Skip to content

Commit

Permalink
DOP-4356 just implement reverse and splice
Browse files Browse the repository at this point in the history
  • Loading branch information
anabellabuckvar committed Feb 8, 2024
1 parent 4c02be7 commit 139d007
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/services/slack.ts
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,7 @@ export class SlackConnector implements ISlackConnector {
// THis is the limitation enforced by slack as no more 100 items are allowd in the dropdown
//'[ERROR] no more than 100 items allowed [json-pointer:/view/blocks/0/element/options]'

reposToShow.sort((a, b) =>
b.text
.toString()
.replace(/\d+/g, (n) => +n + 1000)
.localeCompare(a.text.toString().replace(/\d+/g, (n) => +n + 1000))
);
reposToShow.sort().reverse();

if (reposToShow.length > 100) {
reposToShow = reposToShow.splice(0, 100);
Expand Down

0 comments on commit 139d007

Please sign in to comment.