From b9eff8dac0befbd3659dfe3aaed6fadfca099684 Mon Sep 17 00:00:00 2001 From: Nuwan Date: Mon, 11 Nov 2024 00:42:34 +0530 Subject: [PATCH] debug session history participat letancy --- jam-ui/src/components/profile/JKUserLatencyBadge.js | 6 +++++- jam-ui/src/components/sessions/JKSessionsHistoryItem.js | 5 +++-- jam-ui/src/store/features/latencySlice.js | 1 + 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/jam-ui/src/components/profile/JKUserLatencyBadge.js b/jam-ui/src/components/profile/JKUserLatencyBadge.js index 4b64d883c..c7ff9bdfc 100644 --- a/jam-ui/src/components/profile/JKUserLatencyBadge.js +++ b/jam-ui/src/components/profile/JKUserLatencyBadge.js @@ -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; diff --git a/jam-ui/src/components/sessions/JKSessionsHistoryItem.js b/jam-ui/src/components/sessions/JKSessionsHistoryItem.js index 4e26eaf57..dff006d0c 100644 --- a/jam-ui/src/components/sessions/JKSessionsHistoryItem.js +++ b/jam-ui/src/components/sessions/JKSessionsHistoryItem.js @@ -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]); diff --git a/jam-ui/src/store/features/latencySlice.js b/jam-ui/src/store/features/latencySlice.js index 111e32dce..49f5e0ce1 100644 --- a/jam-ui/src/store/features/latencySlice.js +++ b/jam-ui/src/store/features/latencySlice.js @@ -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() }