From 406ffcd7dec75362eccd55694f6d42744e780751 Mon Sep 17 00:00:00 2001 From: Anmol Singh Bhatia <121005188+anmolsinghbhatia@users.noreply.github.com> Date: Thu, 5 Sep 2024 18:09:10 +0530 Subject: [PATCH] [WEB-2358] fix: recent collaborators (#5532) * fix: recent collaborators * fix: recent collaborators loader --- .../recent-collaborators/collaborators-list.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/web/core/components/dashboard/widgets/recent-collaborators/collaborators-list.tsx b/web/core/components/dashboard/widgets/recent-collaborators/collaborators-list.tsx index bf7b6ac7d4..775980e177 100644 --- a/web/core/components/dashboard/widgets/recent-collaborators/collaborators-list.tsx +++ b/web/core/components/dashboard/widgets/recent-collaborators/collaborators-list.tsx @@ -78,12 +78,17 @@ export const CollaboratorsList: React.FC = (props) => { data: TRecentCollaboratorsWidgetResponse[] | undefined; }; - if (!widgetStats) return ; + if (!widgetStats) + return ( +
+ +
+ ); - const sortedStats = sortBy(widgetStats, [(user) => user.user_id !== currentUser?.id]); + const sortedStats = sortBy(widgetStats, [(user) => user?.user_id !== currentUser?.id]); const filteredStats = sortedStats.filter((user) => { - const { display_name, first_name, last_name } = getUserDetails(user.user_id) || {}; + const { display_name, first_name, last_name } = getUserDetails(user?.user_id) || {}; const searchLower = searchQuery.toLowerCase(); return ( @@ -97,9 +102,9 @@ export const CollaboratorsList: React.FC = (props) => {
{filteredStats?.map((user) => ( ))}