skip showing latency badge if user is currentUser

This commit is contained in:
Nuwan 2024-11-13 21:35:27 +05:30
parent 6366bc5c6e
commit 93961806eb
1 changed files with 5 additions and 1 deletions

View File

@ -7,9 +7,12 @@ import JKLatencyBadge from '../profile/JKLatencyBadge';
import JKProfileSidePanel from '../profile/JKProfileSidePanel';
import JKProfileAvatar from '../profile/JKProfileAvatar';
import PropTypes from 'prop-types';
import { useAuth } from '../../context/UserAuth';
function JKSessionUser({ user }) {
const dispatch = useDispatch();
const { currentUser } = useAuth();
const latencyData = useSelector(state => {
const userLatency = state.latency.latencies.find(l => l.user_id === user.id);
return {
@ -62,7 +65,8 @@ function JKSessionUser({ user }) {
</a>
</div>
<div className="ml-2 ms-2" style={{ marginRight: 'auto' }}>
<JKLatencyBadge latencyData={latencyData} showBadgeOnly={true} />
{ currentUser && currentUser.id !== user.id && <JKLatencyBadge latencyData={latencyData} showBadgeOnly={true} /> }
&nbsp;
</div>
</div>
) : (