Skip to content

Commit

Permalink
Refactor comment sorting order mechanism
Browse files Browse the repository at this point in the history
This commit updates the comment sorting order in the background.js file to descending order. It also changes the list layout in the popup.css file to display items in a column instead of a reverse column.

Instead of sorting with CSS, we'll now sort with the request parameter.

This commit also fixes a bug with sorting in the configurable summary output since the data itself is now sorted.
  • Loading branch information
BagToad committed Jan 22, 2024
1 parent 6f35b43 commit bbde36c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/background/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async function filterTicket() {
// Comment collecting loop section
// *******************************
const rlimit = 25; // Max number of requests to make.
const firstPage = `https://${url.hostname}/api/v2/tickets/${ticketID}/comments`; // URL of the first page of comments.
const firstPage = `https://${url.hostname}/api/v2/tickets/${ticketID}/comments?sort_order=desc`; // URL of the first page of comments.
let nextPage = firstPage; // URL of the next page of comments.
let r = 1; // Number of requests made.

Expand Down
2 changes: 1 addition & 1 deletion src/popup/popup.css
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ h3.list-header {

ul.list-links, ul.list-attachments {
display: flex;
flex-direction: column-reverse;
flex-direction: column;
}

li.list-item-links, li.list-item-attachments {
Expand Down

0 comments on commit bbde36c

Please sign in to comment.