From f89361c02b8bef114717ce67d6776e86b6c44b7c Mon Sep 17 00:00:00 2001 From: Alf Eaton Date: Tue, 17 Jan 2023 12:32:39 +0000 Subject: [PATCH] Fix sorting for output files in PDF preview (#11267) GitOrigin-RevId: 8e8c478c34bf5d58cdb5e44009b918d13ab6a104 --- .../web/frontend/js/features/pdf-preview/util/file-list.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/services/web/frontend/js/features/pdf-preview/util/file-list.js b/services/web/frontend/js/features/pdf-preview/util/file-list.js index 2d0c3ee046..c9edfa828d 100644 --- a/services/web/frontend/js/features/pdf-preview/util/file-list.js +++ b/services/web/frontend/js/features/pdf-preview/util/file-list.js @@ -34,14 +34,14 @@ export const buildFileList = (outputFiles, clsiServerId, compileGroup) => { // sort main files first, then alphabetical allFiles.sort((a, b) => { if (a.main && !b.main) { - return a + return -1 } if (b.main && !a.main) { - return b + return 1 } - return a.path.localeCompare(b.path) + return a.path.localeCompare(b.path, undefined, { numeric: true }) }) // group files into "top" and "other"