Skip to content

Commit

Permalink
fix: sort by numeric file name (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
idootop authored Apr 27, 2024
1 parent 3f5435d commit 7ad3536
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/components/FileSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,12 @@ const FileSelector = ({
}

// Sort by name
temp.sort((a, b) => a.name.localeCompare(b.name));
temp.sort((a, b) =>
a.name.localeCompare(b.name, undefined, {
numeric: true,
sensitivity: "base",
})
);

setFiles(temp);
setSelected(temp[0]);
Expand Down

0 comments on commit 7ad3536

Please sign in to comment.