diff --git a/ACS-Call-Composite/Composite.tsx b/ACS-Call-Composite/Composite.tsx index 48baf26..2161504 100644 --- a/ACS-Call-Composite/Composite.tsx +++ b/ACS-Call-Composite/Composite.tsx @@ -30,14 +30,17 @@ function Composite(props: CompositeProps): JSX.Element { useEffect(() => { const createAdapter = async (): Promise => { - setCallAdapter( + try{setCallAdapter( await createAzureCommunicationCallAdapter({ userId: { communicationUserId: props.userId }, displayName: props.displayName, credential: new AzureCommunicationTokenCredential(props.token), locator: {groupId: props.groupId} }) - ); + )} catch { + console.error('Failed to create call adapter'); + setCallAdapter(undefined); + }; }; if( credential != undefined && props.groupId != "") createAdapter(); }, [credential]); @@ -46,6 +49,9 @@ function Composite(props: CompositeProps): JSX.Element { if (credential === undefined) { return

Failed to construct credential. Provided token is malformed.

; } + if (callAdapter === undefined) { + return

Failed to construct call adapter.

; + } if (props.groupId === "") { return

Provide a valid thread id

; } diff --git a/ACS-Call-Composite/ControlManifest.Input.xml b/ACS-Call-Composite/ControlManifest.Input.xml index 6f6029b..153a347 100644 --- a/ACS-Call-Composite/ControlManifest.Input.xml +++ b/ACS-Call-Composite/ControlManifest.Input.xml @@ -1,6 +1,6 @@ - + - ACS UI Library + ACS_UI_Library