Skip to content

Commit

Permalink
chore: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Dec 12, 2024
1 parent 97f4fdc commit 61baec6
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/home/sorting/sort-by-oldest.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { GitHubAggregated } from "../github-types";

export function sortByOldest(tasks: GitHubAggregated[]) {
return tasks.sort((b,a) => {
return tasks.sort((b, a) => {
const dateA = new Date(a.notification.updated_at);
const dateB = new Date(b.notification.updated_at);
return dateB.getTime() - dateA.getTime();
});
}
}
2 changes: 1 addition & 1 deletion src/home/sorting/sort-by.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { SORTING_OPTIONS } from "./generate-sorting-buttons";
import { sortByPriority } from "./sort-by-priority";
import { sortByOldest } from "./sort-by-oldest";

export function sortBy(tasks: GitHubAggregated[], sortBy: (typeof SORTING_OPTIONS)[number]){
export function sortBy(tasks: GitHubAggregated[], sortBy: (typeof SORTING_OPTIONS)[number]) {
switch (sortBy) {
case "priority":
return sortByPriority(tasks);
Expand Down
2 changes: 1 addition & 1 deletion src/home/sorting/sort-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export function sortIssuesController(tasks: GitHubAggregated[], sorting?: Sortin
if (sorting) {
sortedNotifications = sortBy(sortedNotifications, sorting);
} else {
const sortedByFreshness = sortByOldest(sortedNotifications); // oldest first
const sortedByFreshness = sortByOldest(sortedNotifications); // oldest first
const sortedByPriority = sortByPriority(sortedByFreshness); // highest priority first
sortedNotifications = sortedByPriority;
}
Expand Down

0 comments on commit 61baec6

Please sign in to comment.