diff --git a/frontend/app/components/Assist/RequestingWindow/RequestingWindow.tsx b/frontend/app/components/Assist/RequestingWindow/RequestingWindow.tsx new file mode 100644 index 000000000..7d6f2c790 --- /dev/null +++ b/frontend/app/components/Assist/RequestingWindow/RequestingWindow.tsx @@ -0,0 +1,27 @@ +import React from 'react' +import { INDEXES } from 'App/constants/zindex' +import { connect } from 'react-redux'; +import { Button, Loader, Icon } from 'UI' +import { initiateCallEnd } from 'Player'; + +interface Props { + userDisplayName: string +} + +function RequestingWindow({ userDisplayName }: Props) { + + return ( +
+
+ + Waiting for + {userDisplayName} + to accept the call + + +
+
+ ) +} + +export default connect((state) => ({ userDisplayName: state.getIn(['sessions', 'current', 'userDisplayName']) }))(RequestingWindow) diff --git a/frontend/app/components/Assist/RequestingWindow/index.ts b/frontend/app/components/Assist/RequestingWindow/index.ts new file mode 100644 index 000000000..9dbd99dfe --- /dev/null +++ b/frontend/app/components/Assist/RequestingWindow/index.ts @@ -0,0 +1 @@ +export { default } from './RequestingWindow' diff --git a/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx b/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx index 948b86967..58773acaf 100644 --- a/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx +++ b/frontend/app/components/Assist/components/AssistActions/AssistActions.tsx @@ -54,9 +54,11 @@ function AssistActions({ const [callObject, setCallObject] = useState<{ end: () => void } | null>(null); const onCall = calling === CallingState.OnCall || calling === CallingState.Reconnecting; + const callRequesting = calling === CallingState.Connecting const cannotCall = peerConnectionStatus !== ConnectionStatus.Connected || (isEnterprise && !hasPermission); const remoteActive = remoteControlStatus === RemoteControlStatus.Enabled; + useEffect(() => { return callObject?.end() }, []) @@ -101,6 +103,8 @@ function AssistActions({ }, [agentIds, isCallActive]) const confirmCall = async () => { + if (callRequesting) return; + if ( await confirm({ header: 'Start Call', @@ -112,6 +116,11 @@ function AssistActions({ } }; + const requestControl = () => { + if (callRequesting) return; + requestReleaseRemoteControl() + } + React.useEffect(() => { if (!livePlay) { if (annotating) { @@ -145,8 +154,8 @@ function AssistActions({ )}