Skip to content

Commit

Permalink
Don't change issue/PR sorting in pagination links
Browse files Browse the repository at this point in the history
  • Loading branch information
fregante authored Jan 4, 2018
1 parent 757c805 commit 317fd58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/features/sort-issues-by-update-time.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ export default function () {
[href*="/issues"]:not([href*="sort%3A"]):not(.issues-reset-query),
[href*="/pulls" ]:not([href*="sort%3A"]):not(.issues-reset-query)
`)) {
// Pick only links to lists, not single issues
if (/(issues|pulls)\/?$/.test(link.pathname)) {
// Pick only links to lists, not single issues + skip pagination links
if (/(issues|pulls)\/?$/.test(link.pathname) && !link.closest('.pagination')) {
const search = new URLSearchParams(link.search);
const existingQuery = search.get('q') || getDefaultQuery(link);
search.set('q', `${existingQuery} sort:updated-desc`);
Expand Down

0 comments on commit 317fd58

Please sign in to comment.