Skip to content

Commit

Permalink
feat(ui): order with respect the numeric characters
Browse files Browse the repository at this point in the history
  • Loading branch information
stdword committed Jan 17, 2024
1 parent 51e0ef9 commit 379fdf9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/ui/insert.tsx
Expand Up @@ -53,9 +53,9 @@ async function prepareDataLogic(): Promise<Data> {
})

return data.sort((a, b) => { // by page then by name
const pageDiff = a.page.localeCompare(b.page)
const pageDiff = a.page.localeCompare(b.page, 'en', { numeric: true })
if (pageDiff === 0)
return a.name.localeCompare(b.name)
return a.name.localeCompare(b.name, 'en', { numeric: true })
return pageDiff
})
}
Expand Down

0 comments on commit 379fdf9

Please sign in to comment.