From a8ddb1f3174d667b4150550df5c84bb021c0ffae Mon Sep 17 00:00:00 2001 From: abhimanyurajeesh Date: Thu, 26 Dec 2024 14:01:52 +0530 Subject: [PATCH] fixed issue #9570 --- src/components/Users/UserListAndCard.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/Users/UserListAndCard.tsx b/src/components/Users/UserListAndCard.tsx index ee1ac5e9874..5ceeaca084c 100644 --- a/src/components/Users/UserListAndCard.tsx +++ b/src/components/Users/UserListAndCard.tsx @@ -134,8 +134,12 @@ export const UserStatusIndicator = ({ className?: string; addPadding?: boolean; }) => { - const cur_online = isUserOnline(user); + const authUser = useAuthUser(); // Get the authenticated user's details + const isAuthUser = user.id === authUser.id; // Check if the user is the authenticated user + const cur_online = isUserOnline(user) || isAuthUser; // Assume always online if it's the authenticated user + const { t } = useTranslation(); + return (
- {cur_online - ? t("online") - : user.last_login - ? relativeTime(user.last_login) - : t("never")} + {cur_online ? t("online") : t("offline")}
);