From b07d98a1c126ee26dda9fa3010a73cb20eeeefa0 Mon Sep 17 00:00:00 2001 From: Shaun Tenner Date: Thu, 14 Dec 2023 11:52:53 +0900 Subject: [PATCH] Another attempt to fix order issues --- src/lib/upload/index.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/lib/upload/index.ts b/src/lib/upload/index.ts index df4194f..cee2b23 100644 --- a/src/lib/upload/index.ts +++ b/src/lib/upload/index.ts @@ -107,16 +107,11 @@ export async function processFiles(_files: File[]) { const mangas: string[] = []; const files = _files.sort((a, b) => { - if (a.name < b.name) { - return -1; - } - - if (a.name > b.name) { - return 1; - } - - return 0; - }); + return a.name.localeCompare(b.name, undefined, { + numeric: true, + sensitivity: 'base' + }); + }) for (const file of files) { const { ext, filename, path } = getDetails(file);