Skip to content

Commit b2fcd5a

Browse files
Updated file sharing tutorial for UI library
1 parent eefed2c commit b2fcd5a

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

articles/communication-services/tutorials/file-sharing-tutorial-acs-chat.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,11 +87,11 @@ For this quickstart, we're modifying files inside of the `src` folder.
8787

8888
### Install the package
8989

90-
Use the `npm install` command to install the beta Azure Communication Services UI Library for JavaScript.
90+
Use the `npm install` command to install the latest beta Azure Communication Services UI Library for JavaScript.
9191

9292
```bash
9393

94-
npm install @azure/communication-react@1.16.0-beta.1
94+
npm install @azure/communication-react@1.28.0-beta.2
9595

9696
```
9797

@@ -100,8 +100,8 @@ you can most consistently use the API from the core libraries in your applicatio
100100

101101
```bash
102102

103-
npm install @azure/communication-calling@1.24.1-beta.2
104-
npm install @azure/[email protected].1
103+
npm install @azure/communication-calling@1.36.1-beta.1
104+
npm install @azure/[email protected].7
105105

106106
```
107107

@@ -133,9 +133,9 @@ import {
133133
} from '@azure/communication-react';
134134
import React, { useMemo } from 'react';
135135

136-
initializeFileTypeIcons();
137-
138136
function App(): JSX.Element {
137+
initializeFileTypeIcons();
138+
139139
// Common variables
140140
const endpointUrl = 'INSERT_ENDPOINT_URL';
141141
const userId = ' INSERT_USER_ID';
@@ -167,7 +167,7 @@ function App(): JSX.Element {
167167
);
168168
const chatAdapter = useAzureCommunicationChatAdapter(chatAdapterArgs);
169169

170-
if (!!chatAdapter) {
170+
if (chatAdapter) {
171171
return (
172172
<>
173173
<div style={containerStyle}>
@@ -219,6 +219,7 @@ const uploadFileToAzureBlob = async (uploadTask: AttachmentUploadTask) => {
219219
return {
220220
url: 'https://sample.com/sample.jpg', // Download URL of the file.
221221
};
222+
}
222223

223224
```
224225

@@ -290,6 +291,7 @@ const attachmentSelectionHandler: AttachmentSelectionHandler = async (uploadTask
290291
// Allows you to provide a custom error message.
291292
task.notifyUploadFailed('File too big. Select a file under 99 MB.');
292293
}
294+
...
293295
}
294296
}
295297

@@ -318,7 +320,8 @@ const handler = async (attachment: AttachmentMetadata, message?: ChatMessage) =>
318320
};
319321

320322
const customHandler = = async (attachment: AttachmentMetadata, message?: ChatMessage) => {
321-
if (attachment.extension === "pdf") {
323+
const extension = attachment.name.split(".").pop() || "";
324+
if (extension === "pdf") {
322325
return [
323326
{
324327
title: "Custom button",

0 commit comments

Comments
 (0)