Skip to content

Commit

Permalink
reverse priority strings, keep alphabetical
Browse files Browse the repository at this point in the history
  • Loading branch information
thedannywahl committed Feb 16, 2024
1 parent 13b7ca6 commit f38271f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions isp-site/src/utils/explorer.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ async function getGithubRepoContents(owner, repo, branch) {
});
const data = await response.json();

return data.tree.sort(sortProduct).reverse() || null;
return data.tree.sort(sortProduct) || null;
} catch (error) {
console.error(`Error: ${error.message}`);
return null;
Expand All @@ -39,15 +39,15 @@ function sortProduct(a, b) {
const priorityB = getPriorityIndex(b.path);

if (priorityA !== priorityB) {
return priorityA - priorityB;
return priorityB - priorityA;
}
return a.path.localeCompare(b.path);
}

function formatGithubContents(contents, owner, repo, name, language) {
const l = language;
const s = getStrings(strings, l);
const dirs = contents.filter((item) => item.type === "tree"); // TODO: Sort
const dirs = contents.filter((item) => item.type === "tree");
const files = contents
.filter((item) => item.type === "blob")
.filter((item) => item.path !== ".gitignore");
Expand Down

0 comments on commit f38271f

Please sign in to comment.