Skip to content

Commit

Permalink
improve: do not fetch 'users.info' if live status is available
Browse files Browse the repository at this point in the history
  • Loading branch information
aditya-mitra committed Feb 4, 2021
1 parent 3258542 commit 5549b2a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client/views/room/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const RoomHeader = ({ room }) => {
const liveOtherUserStatusText = useUserData(otherUserQuery?.userId)?.statusText;

// if the other is offline, then liveOtherUserStatusText is undefined
const { value: data } = useEndpointData('users.info', otherUserQuery);
const { value: data } = useEndpointData('users.info', liveOtherUserStatusText === undefined ? otherUserQuery : null);

const roomTopic = liveOtherUserStatusText || data?.user?.statusText || room.topic;

Expand Down

0 comments on commit 5549b2a

Please sign in to comment.