From 09223ea901c8e1608c58e40ac634618e272d7316 Mon Sep 17 00:00:00 2001 From: Adrian Thiele Date: Sat, 2 Sep 2023 16:38:52 +0200 Subject: [PATCH] Fix: Sorting filenames containing numbers Signed-off-by: Adrian Thiele --- src/utils/fileUtils.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/utils/fileUtils.ts b/src/utils/fileUtils.ts index 011f9377e..6db7ad22a 100644 --- a/src/utils/fileUtils.ts +++ b/src/utils/fileUtils.ts @@ -73,8 +73,8 @@ const sortCompare = function(fileInfo1, fileInfo2, key, asc = true) { // finally sort by name return asc - ? fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage()) - : -fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage()) + ? fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage(), { numeric: true }) + : -fileInfo1[key].localeCompare(fileInfo2[key], OC.getLanguage(), { numeric: true }) } export type FileInfo = object