From cbb7ab0c0052c0d886acb1609eb06ce1c3a639c4 Mon Sep 17 00:00:00 2001 From: Irene Ryu Date: Tue, 31 Oct 2023 13:28:43 +0900 Subject: [PATCH 1/2] feat: extendedMessage -> extendedMessagePayload --- src/components/CustomChannelComponent.tsx | 8 ++++---- src/components/CustomMessage.tsx | 2 +- src/utils/messages.ts | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/components/CustomChannelComponent.tsx b/src/components/CustomChannelComponent.tsx index 6b9f23f69..ec14ec1ed 100644 --- a/src/components/CustomChannelComponent.tsx +++ b/src/components/CustomChannelComponent.tsx @@ -134,10 +134,10 @@ export function CustomChannelComponent(props: CustomChannelComponentProps) { }, [lastMessage?.data]); const dynamicReplyOptions = - lastMessage?.extendedMessage != null && - 'suggested_replies' in lastMessage.extendedMessage && - lastMessage.extendedMessage.suggested_replies != null - ? JSON.parse(lastMessage.extendedMessage.suggested_replies) + lastMessage?.extendedMessagePayload != null && + 'suggested_replies' in lastMessage.extendedMessagePayload && + lastMessage.extendedMessagePayload.suggested_replies != null + ? lastMessage.extendedMessagePayload.suggested_replies : []; const isStaticReplyVisible = diff --git a/src/components/CustomMessage.tsx b/src/components/CustomMessage.tsx index 0b506fd14..93d8dc156 100644 --- a/src/components/CustomMessage.tsx +++ b/src/components/CustomMessage.tsx @@ -56,7 +56,7 @@ export default function CustomMessage(props: Props) { } if (isFormMessage(message)) { - const forms = JSON.parse(message.extendedMessage.forms); + const forms = message.extendedMessagePayload.forms; return ( Date: Tue, 31 Oct 2023 15:44:40 +0900 Subject: [PATCH 2/2] Bumpup sendbird deps version to latest --- package-lock.json | 18 +++++++++--------- package.json | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index b39a3b6c8..02a2ab375 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,8 +8,8 @@ "name": "@sendbird/chat-ai-widget", "version": "1.0.8", "dependencies": { - "@sendbird/chat": "^4.9.14", - "@sendbird/uikit-react": "^3.6.9", + "@sendbird/chat": "^4.10.1", + "@sendbird/uikit-react": "^3.7.0", "dompurify": "^3.0.4", "polished": "^2.3.1", "react-code-blocks": "^0.1.0", @@ -1019,9 +1019,9 @@ } }, "node_modules/@sendbird/chat": { - "version": "4.9.14", - "resolved": "https://registry.npmjs.org/@sendbird/chat/-/chat-4.9.14.tgz", - "integrity": "sha512-EBYmO6R0GJuj3eLjVLFQ3s+4I6rqIBSp42KxcCUmGGmU+TICIvzewwvlJk0v2dL56Pfx4NJskU6jaF5D1lLSpw==", + "version": "4.10.1", + "resolved": "https://registry.npmjs.org/@sendbird/chat/-/chat-4.10.1.tgz", + "integrity": "sha512-3BJkb2a5Ds9+1Z6Cb2J8OvFhhe/i8f5gBhXhvOgh+YP0qBDK6necX4IH0Bwh9pW2lvzI1aIs1kN3eNaDSxScaA==", "peerDependencies": { "@react-native-async-storage/async-storage": "^1.17.6" }, @@ -1032,11 +1032,11 @@ } }, "node_modules/@sendbird/uikit-react": { - "version": "3.6.9", - "resolved": "https://registry.npmjs.org/@sendbird/uikit-react/-/uikit-react-3.6.9.tgz", - "integrity": "sha512-uCKSRT3Q5zEvNOpsNnukwXt9QyzSGnXW6bHL4Axuy0OdaE6G8Q2z1dVl4pYQ9102oEGXVTxGhNcNnb6U7pGEpA==", + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/@sendbird/uikit-react/-/uikit-react-3.7.0.tgz", + "integrity": "sha512-T3VFwrXUs0ImLggiMmoRR4J26P4IYYrpxvfENRjPyKUJwCAB8ETqvlCClcaFirTa9XXCS6vhNu38e2Gf25uLmQ==", "dependencies": { - "@sendbird/chat": "^4.9.9", + "@sendbird/chat": "^4.9.14", "@sendbird/uikit-tools": "0.0.1-alpha.40", "css-vars-ponyfill": "^2.3.2", "date-fns": "^2.16.1", diff --git a/package.json b/package.json index 2c0719e4f..a91b7c247 100644 --- a/package.json +++ b/package.json @@ -27,8 +27,8 @@ "preview": "vite preview" }, "dependencies": { - "@sendbird/chat": "^4.9.14", - "@sendbird/uikit-react": "^3.6.9", + "@sendbird/chat": "^4.10.1", + "@sendbird/uikit-react": "^3.7.0", "dompurify": "^3.0.4", "polished": "^2.3.1", "react-code-blocks": "^0.1.0",