From bba1cea7b3d2d79011787ae728758ee9742f7998 Mon Sep 17 00:00:00 2001 From: Andrew Kingston Date: Mon, 24 May 2021 14:16:28 +0100 Subject: [PATCH] Implement real sorting by app updated timestamp --- .../builder/src/pages/builder/portal/apps/index.svelte | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/builder/src/pages/builder/portal/apps/index.svelte b/packages/builder/src/pages/builder/portal/apps/index.svelte index 7857cd658f..9802d5ec36 100644 --- a/packages/builder/src/pages/builder/portal/apps/index.svelte +++ b/packages/builder/src/pages/builder/portal/apps/index.svelte @@ -51,12 +51,16 @@ } return a.status === AppStatus.DEPLOYED ? -1 : 1 }) - } else if (sortBy === "name") { + } else if (sortBy === "updated") { + return enrichedApps.sort((a, b) => { + const aUpdated = a.updatedAt || "9999" + const bUpdated = b.updatedAt || "9999" + return aUpdated < bUpdated ? 1 : -1 + }) + } else { return enrichedApps.sort((a, b) => { return a.name.toLowerCase() < b.name.toLowerCase() ? -1 : 1 }) - } else { - return enrichedApps } }