Skip to content

Commit

Permalink
fixed issue ohcnetwork#9570
Browse files Browse the repository at this point in the history
  • Loading branch information
abhimanyurajeesh committed Dec 26, 2024
1 parent 20fe265 commit a8ddb1f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/components/Users/UserListAndCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div
className={classNames(
Expand All @@ -157,11 +161,7 @@ export const UserStatusIndicator = ({
cur_online ? "text-green-700" : "text-gray-500",
)}
>
{cur_online
? t("online")
: user.last_login
? relativeTime(user.last_login)
: t("never")}
{cur_online ? t("online") : t("offline")}
</span>
</div>
);
Expand Down

0 comments on commit a8ddb1f

Please sign in to comment.