Skip to content

Commit

Permalink
feat: default sort by backlinks in second
Browse files Browse the repository at this point in the history
  • Loading branch information
zugdev committed Dec 17, 2024
1 parent a311f57 commit 7d02b1e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/home/sorting/sort-controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { GitHubAggregated } from "../github-types";
import { Sorting } from "./generate-sorting-buttons";
import { sortBy } from "./sort-by";
import { sortByPriority } from "./sort-by-priority";
import { sortByBacklinks } from "./sort-by-backlinks";
import { sortByActivity } from "./sort-by-activity";

export function sortIssuesController(tasks: GitHubAggregated[], sorting?: Sorting, options = { ordering: "normal" }) {
Expand All @@ -10,8 +11,12 @@ export function sortIssuesController(tasks: GitHubAggregated[], sorting?: Sortin
if (sorting) {
sortedNotifications = sortBy(sortedNotifications, sorting);
} else {
const sortedByFreshness = sortByActivity(sortedNotifications); // activity first
const sortedByPriority = sortByPriority(sortedByFreshness); // highest priority first
const sortedByFreshness = sortByActivity(sortedNotifications); // activity last
console.log("sortedByFreshness", sortedByFreshness);
const sortedByBacklinks = sortByBacklinks(sortedByFreshness); // backlinks second
console.log("sortedByBacklinks", sortedByBacklinks);
const sortedByPriority = sortByPriority(sortedByBacklinks); // highest priority first
console.log("sortedByPriority", sortedByPriority);
sortedNotifications = sortedByPriority;
}

Expand Down

0 comments on commit 7d02b1e

Please sign in to comment.