stream-chat-react 13.6.4 → 13.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -24,7 +24,7 @@ export const useChat = ({ client, defaultLanguage = 'en', i18nInstance, initialN
|
|
|
24
24
|
useEffect(() => {
|
|
25
25
|
if (!client)
|
|
26
26
|
return;
|
|
27
|
-
const version = "13.6.
|
|
27
|
+
const version = "13.6.5";
|
|
28
28
|
const userAgent = client.getUserAgent();
|
|
29
29
|
if (!userAgent.includes('stream-chat-react')) {
|
|
30
30
|
// result looks like: 'stream-chat-react-2.3.2-stream-chat-javascript-client-browser-2.2.2'
|
|
@@ -88,14 +88,17 @@ const useAttachmentSelectorActionsFiltered = (original) => {
|
|
|
88
88
|
const { PollCreationDialog = DefaultPollCreationDialog, ShareLocationDialog = DefaultLocationDialog, } = useComponentContext();
|
|
89
89
|
const { channelCapabilities } = useChannelStateContext();
|
|
90
90
|
const messageComposer = useMessageComposer();
|
|
91
|
+
const channelConfig = messageComposer.channel.getConfig();
|
|
91
92
|
return original
|
|
92
93
|
.filter((action) => {
|
|
93
94
|
if (action.type === 'uploadFile')
|
|
94
|
-
return channelCapabilities['upload-file'];
|
|
95
|
+
return channelCapabilities['upload-file'] && channelConfig?.uploads;
|
|
95
96
|
if (action.type === 'createPoll')
|
|
96
|
-
return channelCapabilities['send-poll'] &&
|
|
97
|
+
return (channelCapabilities['send-poll'] &&
|
|
98
|
+
!messageComposer.threadId &&
|
|
99
|
+
channelConfig?.polls);
|
|
97
100
|
if (action.type === 'addLocation') {
|
|
98
|
-
return
|
|
101
|
+
return channelConfig?.shared_locations && !messageComposer.threadId;
|
|
99
102
|
}
|
|
100
103
|
return true;
|
|
101
104
|
})
|
package/dist/index.browser.cjs
CHANGED
|
@@ -32204,12 +32204,14 @@ var useAttachmentSelectorActionsFiltered = (original) => {
|
|
|
32204
32204
|
} = useComponentContext();
|
|
32205
32205
|
const { channelCapabilities } = useChannelStateContext();
|
|
32206
32206
|
const messageComposer = useMessageComposer();
|
|
32207
|
+
const channelConfig = messageComposer.channel.getConfig();
|
|
32207
32208
|
return original.filter((action) => {
|
|
32208
|
-
if (action.type === "uploadFile")
|
|
32209
|
+
if (action.type === "uploadFile")
|
|
32210
|
+
return channelCapabilities["upload-file"] && channelConfig?.uploads;
|
|
32209
32211
|
if (action.type === "createPoll")
|
|
32210
|
-
return channelCapabilities["send-poll"] && !messageComposer.threadId;
|
|
32212
|
+
return channelCapabilities["send-poll"] && !messageComposer.threadId && channelConfig?.polls;
|
|
32211
32213
|
if (action.type === "addLocation") {
|
|
32212
|
-
return
|
|
32214
|
+
return channelConfig?.shared_locations && !messageComposer.threadId;
|
|
32213
32215
|
}
|
|
32214
32216
|
return true;
|
|
32215
32217
|
}).map((action) => {
|
|
@@ -36159,7 +36161,7 @@ var useChat = ({
|
|
|
36159
36161
|
};
|
|
36160
36162
|
(0, import_react282.useEffect)(() => {
|
|
36161
36163
|
if (!client) return;
|
|
36162
|
-
const version = "13.6.
|
|
36164
|
+
const version = "13.6.5";
|
|
36163
36165
|
const userAgent = client.getUserAgent();
|
|
36164
36166
|
if (!userAgent.includes("stream-chat-react")) {
|
|
36165
36167
|
client.setUserAgent(`stream-chat-react-${version}-${userAgent}`);
|