skip showing latency badge if user is currentUser
This commit is contained in:
parent
6366bc5c6e
commit
93961806eb
|
|
@ -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} /> }
|
||||
|
||||
</div>
|
||||
</div>
|
||||
) : (
|
||||
|
|
|
|||
Loading…
Reference in New Issue