bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/activity-check/container.jsx

29 lines
1.0 KiB
React
Raw Normal View History

2019-02-27 01:40:01 +08:00
import React from 'react';
import { injectIntl } from 'react-intl';
import { useMutation } from '@apollo/client';
2019-02-27 01:40:01 +08:00
import ActivityCheck from './component';
import { USER_SEND_ACTIVITY_SIGN } from './mutations';
import useCurrentUser from '/imports/ui/core/hooks/useCurrentUser';
2019-02-27 01:40:01 +08:00
const ActivityCheckContainer = () => {
const [userActivitySign] = useMutation(USER_SEND_ACTIVITY_SIGN);
const { data: currentUserData } = useCurrentUser((user) => ({
inactivityWarningDisplay: user.inactivityWarningDisplay,
inactivityWarningTimeoutSecs: user.inactivityWarningTimeoutSecs,
}));
const inactivityWarningDisplay = currentUserData?.inactivityWarningDisplay;
const inactivityWarningTimeoutSecs = currentUserData?.inactivityWarningTimeoutSecs;
if (!inactivityWarningDisplay) return null;
return (
<ActivityCheck
userActivitySign={userActivitySign}
inactivityCheck={inactivityWarningDisplay}
responseDelay={inactivityWarningTimeoutSecs}
/>
);
};
2019-02-27 01:40:01 +08:00
export default injectIntl(ActivityCheckContainer);