Quellcode durchsuchen

sort apps correctly (#3887)

ianedwards vor 2 Jahren
Ursprung
Commit
1c803713cd
1 geänderte Dateien mit 12 neuen und 2 gelöschten Zeilen
  1. 12 2
      dashboard/src/main/home/app-dashboard/apps/AppGrid.tsx

+ 12 - 2
dashboard/src/main/home/app-dashboard/apps/AppGrid.tsx

@@ -64,9 +64,19 @@ const AppGrid: React.FC<AppGridProps> = ({ apps, searchValue, view, sort }) => {
 
     return match(sort)
       .with("calendar", () =>
-        _.sortBy(filteredBySearch, ["last_deployed"]).reverse()
+        _.sortBy(filteredBySearch, [
+          (a) => {
+            return a.app_revision.updated_at;
+          },
+        ]).reverse()
+      )
+      .with("letter", () =>
+        _.sortBy(filteredBySearch, [
+          (a) => {
+            return a.source.name;
+          },
+        ])
       )
-      .with("letter", () => _.sortBy(filteredBySearch, ["name"]))
       .exhaustive();
   }, [appsWithProto, searchValue, sort]);