diff --git a/jam-ui/src/components/client/JKResyncButton.js b/jam-ui/src/components/client/JKResyncButton.js index 3840d6ca5..8ff3c42c6 100644 --- a/jam-ui/src/components/client/JKResyncButton.js +++ b/jam-ui/src/components/client/JKResyncButton.js @@ -12,33 +12,30 @@ import PropTypes from 'prop-types'; const JKResyncButton = memo(({ resyncAudio, className }) => { const [loading, setLoading] = useState(false); - const handleClick = useCallback(async (e) => { - e.preventDefault(); - if (loading) return; + const handleClick = useCallback( + async e => { + e.preventDefault(); + if (loading) return; - setLoading(true); - try { - await resyncAudio(); - // Silent success (matches legacy behavior) - } catch (error) { - if (error.message === 'timeout') { - toast.error('Audio resync timed out. Please try again.'); - } else { - toast.error('Audio resync failed: ' + (error.message || 'Unknown error')); + setLoading(true); + try { + await resyncAudio(); + // Silent success (matches legacy behavior) + } catch (error) { + if (error.message === 'timeout') { + toast.error('Audio resync timed out. Please try again.'); + } else { + toast.error('Audio resync failed: ' + (error.message || 'Unknown error')); + } + } finally { + setLoading(false); } - } finally { - setLoading(false); - } - }, [resyncAudio, loading]); + }, + [resyncAudio, loading] + ); return ( - - + getVideoConferencingRoomUrl(currentSession.id)} + onUpgradePrompt={showVideoUpgradePrompt} + /> - + diff --git a/jam-ui/src/components/client/JKVideoButton.js b/jam-ui/src/components/client/JKVideoButton.js index 276881504..282a2745e 100644 --- a/jam-ui/src/components/client/JKVideoButton.js +++ b/jam-ui/src/components/client/JKVideoButton.js @@ -10,16 +10,11 @@ import videoIcon from '../../assets/images/icons8-video-call-50.png'; * * State colocation: https://kentcdodds.com/blog/state-colocation-will-make-your-react-app-faster */ -const JKVideoButton = memo(({ - canVideo, - getVideoUrl, - onUpgradePrompt, - className -}) => { +const JKVideoButton = memo(({ canVideo, getVideoUrl, onUpgradePrompt, className }) => { const [loading, setLoading] = useState(false); // Open external link in new window/tab - const openExternalLink = useCallback((url) => { + const openExternalLink = useCallback(url => { window.open(url, '_blank', 'noopener,noreferrer'); }, []); @@ -38,7 +33,6 @@ const JKVideoButton = memo(({ // Open video URL in new browser window/tab openExternalLink(videoUrl); - } catch (error) { toast.error('Failed to start video session'); } finally { @@ -48,18 +42,8 @@ const JKVideoButton = memo(({ }, [canVideo, getVideoUrl, onUpgradePrompt, openExternalLink]); return ( -