From 8493c8947458e20995aabc3a641a87fe98ddb38e Mon Sep 17 00:00:00 2001 From: Aakash Reddy Date: Mon, 23 Dec 2024 19:39:07 +0530 Subject: [PATCH] fix: resolved workspace sorting with time/[#1923] --- .../components/workspace-grid-view/WorkspaceGridView.svelte | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/@sparrow-teams/src/features/team-explorer/components/workspace-grid-view/WorkspaceGridView.svelte b/packages/@sparrow-teams/src/features/team-explorer/components/workspace-grid-view/WorkspaceGridView.svelte index f8d469cc2..671211f0d 100644 --- a/packages/@sparrow-teams/src/features/team-explorer/components/workspace-grid-view/WorkspaceGridView.svelte +++ b/packages/@sparrow-teams/src/features/team-explorer/components/workspace-grid-view/WorkspaceGridView.svelte @@ -52,7 +52,11 @@ typeof item.name === "string" && item.name.toLowerCase().includes(searchQuery.toLowerCase()), ) - .sort((a, b) => a.name.localeCompare(b.name)); // will arrange workspace aplhabetically + .sort( + (a, b) => + new Date(b._data.updatedAt).getTime() - + new Date(a._data.updatedAt).getTime(), + ); // This will split workspaces into pages $: paginatedWorkspaces = (() => {