debug session history participat letancy

This commit is contained in:
Nuwan 2024-11-11 00:42:34 +05:30
parent c42dfdbb30
commit b9eff8dac0
3 changed files with 9 additions and 3 deletions

View File

@ -17,6 +17,10 @@ const JKUserLatency = ({user, showAll, showBadgeOnly}) => {
);
};
JKUserLatency.propTypes = { user: PropTypes.object.isRequired };
JKUserLatency.propTypes = {
user: PropTypes.object.isRequired,
showAll: PropTypes.bool,
showBadgeOnly: PropTypes.bool
};
export default JKUserLatency;

View File

@ -45,11 +45,12 @@ const JKSessionsHistoryItem = ({ session_id, sessionGroup }) => {
useEffect(() => {
console.log('participants', participants);
if (participants.length > 0 && currentUser) {
const currentUserId = currentUser.id;
const otherUserIds = participants.filter(p => p.id !== currentUserId).map(p => p.id);
fetchUserLatencies({ otherUserIds, currentUserId });
console.log('X_DEBUG_ JKSessionsHistoryItem', currentUserId, otherUserIds);
fetchUserLatencies({ currentUserId, otherUserIds});
}
}, [participants]);

View File

@ -11,6 +11,7 @@ export const fetchUserLatencies = createAsyncThunk(
'latency/fetchUserLatencies',
async (options, thunkAPI) => {
const { currentUserId, otherUserIds } = options
console.log('X_DEBUG_ fetchUserLatencies', currentUserId, otherUserIds)
const response = await getLatencyToUsers(currentUserId, otherUserIds)
return response.json()
}