bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/connection-status/modal/container.jsx
Tainan Felipe 3bc40df230
Add: useDeduplicatedSubscription hook (#20376)
* Add: useDeduplicatedSubscription hook

* Fix: TS error

* Add: components using useDeduplicatedSubscription

* Change: Move to useDeduplicatedSubscription

* Change: unsubscribe logic to own useEffect

* Change: remove file import over package

* Fix: TS errors

* Fix: private chat not loading

* Change: revert changes on queries

* Fix: eslint error

* Remove: html-webpack-plugin package

* Fix: external video

* Add: comment about the stringToHash function

* Fix: video player showing tools over presentation
2024-06-04 10:40:54 -03:00

31 lines
1.2 KiB
JavaScript

import React from 'react';
import { CONNECTION_STATUS_REPORT_SUBSCRIPTION } from '../queries';
import Service from '../service';
import Component from './component';
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
import { useGetStats } from '../../video-provider/video-provider-graphql/hooks';
import useDeduplicatedSubscription from '/imports/ui/core/hooks/useDeduplicatedSubscription';
const ConnectionStatusContainer = (props) => {
const { data } = useDeduplicatedSubscription(CONNECTION_STATUS_REPORT_SUBSCRIPTION);
const connectionData = data ? Service.sortConnectionData(data.user_connectionStatusReport) : [];
const { data: currentUser } = useCurrentUser((u) => ({ isModerator: u.isModerator }));
const amIModerator = !!currentUser?.isModerator;
const { isGridLayout, paginationsEnabled, viewParticipantsWebcams } = props;
const getVideoStreamsStats = useGetStats(
isGridLayout,
paginationsEnabled,
viewParticipantsWebcams,
);
return (
<Component
connectionData={connectionData}
amIModerator={amIModerator}
getVideoStreamsStats={getVideoStreamsStats}
{...props}
/>
);
};
export default ConnectionStatusContainer;