38b568b0c7
The isSharing var is content type agnostic, so it's picking up camera as content to flag the actions-bar button loading state. Change the loading flag to track isScreenBroadcasting (contentType=screen, local || global) and isScreenGloballyBroadcasting (contentType=screen, global only). Fixes the camera as content false positive as well as the loading state itself.
33 lines
1.2 KiB
JavaScript
33 lines
1.2 KiB
JavaScript
import React from 'react';
|
|
import ScreenshareButton from './component';
|
|
import { useIsScreenSharingEnabled } from '/imports/ui/services/features';
|
|
import { useIsScreenBroadcasting, useIsScreenGloballyBroadcasting } from '/imports/ui/components/screenshare/service';
|
|
import useSettings from '/imports/ui/services/settings/hooks/useSettings';
|
|
import { SETTINGS } from '/imports/ui/services/settings/enums';
|
|
|
|
const ScreenshareButtonContainer = (props) => {
|
|
const { viewScreenshare: screenshareDataSavingSetting } = useSettings(SETTINGS.DATA_SAVING);
|
|
const screenIsBroadcasting = useIsScreenBroadcasting();
|
|
const { screenIsShared: isScreenGloballyBroadcasting } = useIsScreenGloballyBroadcasting();
|
|
const enabled = useIsScreenSharingEnabled();
|
|
return (
|
|
<ScreenshareButton
|
|
screenshareDataSavingSetting={screenshareDataSavingSetting}
|
|
isScreenBroadcasting={screenIsBroadcasting}
|
|
isScreenGloballyBroadcasting={isScreenGloballyBroadcasting}
|
|
enabled={enabled}
|
|
{...props}
|
|
/>
|
|
);
|
|
};
|
|
|
|
/*
|
|
* All props, including the ones that are inherited from actions-bar
|
|
* isScreenBroadcasting,
|
|
* amIPresenter,
|
|
* screenSharingCheck,
|
|
* isMeteorConnected,
|
|
* screenshareDataSavingSetting,
|
|
*/
|
|
export default ScreenshareButtonContainer;
|