|
1 | 1 | # Changelog - v3 |
| 2 | + |
| 3 | +## [v3.7.0] (Oct 23 2023) |
| 4 | + |
| 5 | +### Multiple Files Message |
| 6 | +Now we are supporting Multiple Files Message feature!<br/> |
| 7 | +You can select some **multiple files** in the message inputs, and send **multiple images** in one message.<br/> |
| 8 | +If you select several types of files, only images will be combined in the message and the other files will be sent separately. |
| 9 | +Also we have resolved many issues found during QA. |
| 10 | + |
| 11 | +#### How to enable this feature? |
| 12 | +You can turn it on in four places. |
| 13 | + |
| 14 | +1. App Component |
| 15 | +```tsx |
| 16 | +import App from '@sendbird/uikit-react/App' |
| 17 | + |
| 18 | +<App |
| 19 | + ... |
| 20 | + isMultipleFilesMessageEnabled |
| 21 | +/> |
| 22 | +``` |
| 23 | +2. SendbirdProvider |
| 24 | +```tsx |
| 25 | +import { SendbirdProvider } from '@sendbird/uikit-react/SendbirdProvider' |
| 26 | + |
| 27 | +<SendbirdProvider |
| 28 | + ... |
| 29 | + isMultipleFilesMessageEnabled |
| 30 | +> |
| 31 | + {...} |
| 32 | +</SendbirdProvider> |
| 33 | +``` |
| 34 | +3. Channel |
| 35 | +```tsx |
| 36 | +import Channel from '@sendbird/uikit-react/Channel'; |
| 37 | +import { ChannelProvider } from '@sendbird/uikit-react/Channel/context'; |
| 38 | + |
| 39 | +<Channel |
| 40 | + ... |
| 41 | + isMultipleFilesMessageEnabled |
| 42 | +/> |
| 43 | +<ChannelProvider |
| 44 | + ... |
| 45 | + isMultipleFilesMessageEnabled |
| 46 | +> |
| 47 | + {...} |
| 48 | +</ChannelProvider> |
| 49 | +``` |
| 50 | +3. Thread |
| 51 | +```tsx |
| 52 | +import Thread from '@sendbird/uikit-react/Thread'; |
| 53 | +import { ThreadProvider } from '@sendbird/uikit-react/Thread/context'; |
| 54 | + |
| 55 | +<Thread |
| 56 | + ... |
| 57 | + isMultipleFilesMessageEnabled |
| 58 | +/> |
| 59 | +<ThreadProvider |
| 60 | + ... |
| 61 | + isMultipleFilesMessageEnabled |
| 62 | +> |
| 63 | + {...} |
| 64 | +</ThreadProvider> |
| 65 | +``` |
| 66 | + |
| 67 | +### Interface change/publish |
| 68 | +* The properties of the `ChannelContext` and `ThreadContext` has been changed little bit. |
| 69 | + * `allMessages` of the ChannelContext has been divided into `allMessages` and `localMessages` |
| 70 | + * `allThreadMessages` of the ThreadContext has been divided into `allThreadMessages` and `localThreadMessages` |
| 71 | + * Each local messages includes `pending` and `failed` messages, and the all messages will contain only `succeeded` messages |
| 72 | + * **Please keep in mind, you have to migrate to using the local messages, IF you have used the `local messages` to draw your custom message components.** |
| 73 | +* pubSub has been published |
| 74 | + * `publishingModules` has been added to the payload of pubSub.publish |
| 75 | + You can specify the particular modules that you propose for event publishing |
| 76 | + ```tsx |
| 77 | + import { useCallback } from 'react' |
| 78 | + import { SendbirdProvider, useSendbirdStateContext } from '@sendbird/uikit-react/SendbirdProvider' |
| 79 | + import { PUBSUB_TOPICS as topics, PublishingModuleTypes } from '@sendbird/uikit-react/pubSub/topics' |
| 80 | + |
| 81 | + const CustomApp = () => { |
| 82 | + const globalState = useSendbirdStateContext(); |
| 83 | + const { stores, config } = globalState; |
| 84 | + const { sdk, initialized } = stores.sdkStore; |
| 85 | + const { pubSub } = config; |
| 86 | + |
| 87 | + const onSendFileMessageOnlyInChannel = useCallback((channel, params) => { |
| 88 | + channel.sendFileMessage(params) |
| 89 | + .onPending((pendingMessage) => { |
| 90 | + pubSub.publish(topics.SEND_MESSAGE_START, { |
| 91 | + channel, |
| 92 | + message: pendingMessage, |
| 93 | + publishingModules: [PublishingModuleTypes.CHANNEL], |
| 94 | + }); |
| 95 | + }) |
| 96 | + .onFailed((failedMessage) => { |
| 97 | + pubSub.publish(topics.SEND_MESSAGE_FAILED, { |
| 98 | + channel, |
| 99 | + message: failedMessage, |
| 100 | + publishingModules: [PublishingModuleTypes.CHANNEL], |
| 101 | + }); |
| 102 | + }) |
| 103 | + .onSucceeded((succeededMessage) => { |
| 104 | + pubSub.publish(topics.SEND_FILE_MESSAGE, { |
| 105 | + channel, |
| 106 | + message: succeededMessage, |
| 107 | + publishingModules: [PublishingModuleTypes.CHANNEL], |
| 108 | + }); |
| 109 | + }) |
| 110 | + }, []); |
| 111 | + |
| 112 | + return (<>...</>) |
| 113 | + }; |
| 114 | + |
| 115 | + const App = () => ( |
| 116 | + <SendbirdProvider> |
| 117 | + <CustomApp /> |
| 118 | + </SendbirdProvider> |
| 119 | + ); |
| 120 | + ``` |
| 121 | + |
| 122 | +### Fixes: |
| 123 | +* Improve the pubSub&dispatch logics |
| 124 | +* Allow deleting failed messages |
| 125 | +* Check applicationUserListQuery.isLoading before fetching user list |
| 126 | + * Fix the error message: "Query in progress." |
| 127 | +* Fix missed or wrong type definitions |
| 128 | + * `quoteMessage` of ChannelProviderInterface |
| 129 | + * `useEditUserProfileProviderContext` has been renamed to `useEditUserProfileContext` |
| 130 | + ```tsx |
| 131 | + import { useEditUserProfileProviderContext } from '@sendbird/uikit-react/EditUserProfile/context' |
| 132 | + // to |
| 133 | + import { useEditUserProfileContext } from '@sendbird/uikit-react/EditUserProfile/context' |
| 134 | + ``` |
| 135 | + |
2 | 136 | ## [v3.6.10] (Oct 11 2023) |
3 | 137 | ### Fixes: |
4 | 138 | * (in Safari) Display the placeholder of the MessageInput when the input text is cleared |
|
0 commit comments