فهرست منبع

Merge pull request #2977 from overleaf/jpa-import-697

[ProjectController] fix the sorting of project entities for node v11+

GitOrigin-RevId: d4458aeaf83f610e36669050e664c902dbcce36e
Jakob Ackermann 6 سال پیش
والد
کامیت
398d2deb07
1فایلهای تغییر یافته به همراه2 افزوده شده و 1 حذف شده
  1. 2 1
      services/web/app/src/Features/Project/ProjectController.js

+ 2 - 1
services/web/app/src/Features/Project/ProjectController.js

@@ -362,7 +362,8 @@ const ProjectController = {
           }
           }
           const entities = docs
           const entities = docs
             .concat(files)
             .concat(files)
-            .sort((a, b) => a.path > b.path) // Sort by path ascending
+            // Sort by path ascending
+            .sort((a, b) => (a.path > b.path ? 1 : a.path < b.path ? -1 : 0))
             .map(e => ({
             .map(e => ({
               path: e.path,
               path: e.path,
               type: e.doc != null ? 'doc' : 'file'
               type: e.doc != null ? 'doc' : 'file'