From 611f84c0d17b19735b35c496700a1c64e22b9385 Mon Sep 17 00:00:00 2001 From: Adithya Vardhan Date: Tue, 17 Sep 2024 14:16:16 +0530 Subject: [PATCH] chore: order apps by last used (#658) --- frontend/src/screens/apps/AppList.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/screens/apps/AppList.tsx b/frontend/src/screens/apps/AppList.tsx index dcc1539a..62e933b0 100644 --- a/frontend/src/screens/apps/AppList.tsx +++ b/frontend/src/screens/apps/AppList.tsx @@ -20,9 +20,13 @@ function AppList() { } const albyConnection = apps.find((x) => x.name === albyConnectionName); - const otherApps = apps.filter( - (x) => x.nostrPubkey !== albyConnection?.nostrPubkey - ); + const otherApps = apps + .filter((x) => x.nostrPubkey !== albyConnection?.nostrPubkey) + .sort( + (a, b) => + new Date(b.lastEventAt ?? 0).getTime() - + new Date(a.lastEventAt ?? 0).getTime() + ); return ( <>