Skip to content

Commit e213bf1

Browse files
Merge branch 'master' into 3.4.6-changelog
2 parents 4ffd57c + fe29c19 commit e213bf1

File tree

7 files changed

+46
-41
lines changed

7 files changed

+46
-41
lines changed

docs/build/bundle.7737a136.js renamed to docs/build/bundle.571d5957.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/build/bundle.7737a136.js.LICENSE.txt renamed to docs/build/bundle.571d5957.js.LICENSE.txt

Lines changed: 11 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/*! exports provided: 0, 128, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140, 142, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155, 156, 158, 159, default */
22

3-
/*! exports provided: 1 reply, Attach files, Cancel, Channel Missing, Close, Connection failure, reconnecting now..., Delete, Delivered, Edit Message, Empty message..., Error adding flag: Either the flag already exist or there is issue with network connection ..., Error connecting to chat, refresh the page to try again., Error muting a user ..., Error unmuting a user ..., Error · Unsent, Error: {{ errorMessage }}, Flag, Message Failed · Click to try again, Message deleted, Message failed. Click to try again., Message has been successfully flagged, Mute, New, New Messages!, Nothing yet..., Only visible to you, Open emoji picker, Pick your emoji, Send, Sending..., Start of a new thread, This message was deleted..., Thread, Type your message, Unmute, You have no channels currently, You've reached the maximum number of files, live, this content could not be displayed, {{ commaSeparatedUsers }} and {{ lastUser }} are typing..., {{ commaSeparatedUsers }} and {{ moreCount }} more, {{ commaSeparatedUsers }}, and {{ lastUser }}, {{ firstUser }} and {{ secondUser }}, {{ firstUser }} and {{ secondUser }} are typing..., {{ imageCount }} more, {{ memberCount }} members, {{ replyCount }} replies, {{ user }} has been muted, {{ user }} has been unmuted, {{ user }} is typing..., {{ watcherCount }} online, 🏙 Attachment..., default */
3+
/*! exports provided: 1 reply, Attach files, Cancel, Channel Missing, Close, Commands matching, Connection failure, reconnecting now..., Delete, Delivered, Edit Message, Emoji matching, Empty message..., Error adding flag: Either the flag already exist or there is issue with network connection ..., Error connecting to chat, refresh the page to try again., Error muting a user ..., Error unmuting a user ..., Error · Unsent, Error: {{ errorMessage }}, Flag, Message Failed · Click to try again, Message deleted, Message failed. Click to try again., Message has been successfully flagged, Mute, New, New Messages!, Nothing yet..., Only visible to you, Open emoji picker, Pick your emoji, Searching for people, Send, Sending..., Start of a new thread, This message was deleted..., Thread, Type your message, Unmute, You have no channels currently, You've reached the maximum number of files, live, this content could not be displayed, {{ commaSeparatedUsers }} and {{ lastUser }} are typing..., {{ commaSeparatedUsers }} and {{ moreCount }} more, {{ commaSeparatedUsers }}, and {{ lastUser }}, {{ firstUser }} and {{ secondUser }}, {{ firstUser }} and {{ secondUser }} are typing..., {{ imageCount }} more, {{ memberCount }} members, {{ replyCount }} replies, {{ user }} has been muted, {{ user }} has been unmuted, {{ user }} is typing..., {{ watcherCount }} online, 🏙 Attachment..., default */
44

55
/*! exports provided: ACORN_OPTIONS, default */
66

@@ -16,11 +16,11 @@
1616

1717
/*! exports provided: Attachment, Card, Audio, AttachmentActions, FileAttachment */
1818

19-
/*! exports provided: Attachment, Card, Audio, AttachmentActions, FileAttachment, AutoCompleteTextarea, KEY_CODES, Item, List, defaultScrollToItem, listener, Avatar, ChannelPreview, ChannelPreviewCompact, ChannelPreviewCountOnly, ChannelPreviewLastMessage, ChannelPreviewMessenger, Channel, useChannelEditMessageHandler, useChannelMentionsHandler, ChannelHeader, ChannelList, ChannelListMessenger, ChannelListTeam, ChannelSearch, Chat, ChatAutoComplete, ChatDown, CommandItem, DateSeparator, EmoticonItem, EmptyStateIndicator, EventComponent, Gallery, ImageComponent, ModalImage, ModalWrapper, InfiniteScroll, InfiniteScrollPaginator, ReverseInfiniteScroll, LoadingChannels, LoadingErrorIndicator, LoadingIndicator, LoadMoreButton, LoadMorePaginator, Message, MessageCommerce, MessageLivestream, MessageSimple, MessageTeam, MessageRepliesCountButton, MessageOptions, MessageText, MessageDeleted, FixedHeightMessage, handleActionWarning, useActionHandler, useDeleteHandler, useEditHandler, missingUseFlagHandlerParameterWarning, useFlagHandler, useMentionsHandler, useMentionsUIHandler, missingUseMuteHandlerParamsWarning, useMuteHandler, useOpenThreadHandler, reactionHandlerWarning, useReactionHandler, useReactionClick, useRetryHandler, useUserHandler, useUserRole, validateAndGetMessage, isUserMuted, MESSAGE_ACTIONS, getMessageActions, areMessagePropsEqual, shouldMessageComponentUpdate, messageHasReactions, messageHasAttachments, getImages, getNonImageAttachments, getReadByTooltipText, MessagePropTypes, MessageActionsBox, MessageActions, MessageInput, MessageInputFlat, MessageInputLarge, MessageInputSmall, MessageInputSimple, EditMessageForm, EmojiPicker, SendButton, UploadsPreview, useMessageInput, MessageList, VirtualizedMessageList, MessageNotification, ConnectionStatus, Modal, ReactionSelector, ReactionsList, SimpleReactionsList, SafeAnchor, Thread, Tooltip, TypingIndicator, UserItem, Window */
19+
/*! exports provided: Attachment, Card, Audio, AttachmentActions, FileAttachment, AutoCompleteTextarea, Item, List, listener, KEY_CODES, defaultScrollToItem, Avatar, ChannelPreview, ChannelPreviewCompact, ChannelPreviewCountOnly, ChannelPreviewLastMessage, ChannelPreviewMessenger, Channel, useChannelEditMessageHandler, useChannelMentionsHandler, ChannelHeader, ChannelList, ChannelListMessenger, ChannelListTeam, ChannelSearch, Chat, ChatAutoComplete, ChatDown, CommandItem, DateSeparator, EmoticonItem, EmptyStateIndicator, EventComponent, Gallery, ImageComponent, ModalImage, ModalWrapper, InfiniteScroll, InfiniteScrollPaginator, ReverseInfiniteScroll, LoadingChannels, LoadingErrorIndicator, LoadingIndicator, LoadMoreButton, LoadMorePaginator, Message, MessageCommerce, MessageLivestream, MessageSimple, MessageTeam, MessageRepliesCountButton, MessageOptions, MessageText, MessageDeleted, FixedHeightMessage, handleActionWarning, useActionHandler, useDeleteHandler, useEditHandler, missingUseFlagHandlerParameterWarning, useFlagHandler, useMentionsHandler, useMentionsUIHandler, missingUseMuteHandlerParamsWarning, useMuteHandler, useOpenThreadHandler, reactionHandlerWarning, useReactionHandler, useReactionClick, useRetryHandler, useUserHandler, useUserRole, validateAndGetMessage, isUserMuted, MESSAGE_ACTIONS, getMessageActions, areMessagePropsEqual, shouldMessageComponentUpdate, messageHasReactions, messageHasAttachments, getImages, getNonImageAttachments, getReadByTooltipText, MessagePropTypes, MessageActionsBox, MessageActions, MessageInput, MessageInputFlat, MessageInputLarge, MessageInputSmall, MessageInputSimple, EditMessageForm, EmojiPicker, SendButton, UploadsPreview, useMessageInput, MessageList, VirtualizedMessageList, MessageNotification, ConnectionStatus, Modal, ReactionSelector, ReactionsList, SimpleReactionsList, SafeAnchor, Thread, Tooltip, TypingIndicator, UserItem, Window */
2020

2121
/*! exports provided: AttachmentIcon, FileIcon, FilePreviewer, FileUploadButton, IconButton, ImageDropzone, ImagePreviewer, ImageUploadButton, LoadingIndicator, PictureIcon, Thumbnail, ThumbnailPlaceholder, dataTransferItemsHaveFiles, dataTransferItemsToFiles */
2222

23-
/*! exports provided: AutoCompleteTextarea, KEY_CODES, Item, List, defaultScrollToItem, listener */
23+
/*! exports provided: AutoCompleteTextarea, Item, List, listener, KEY_CODES, defaultScrollToItem */
2424

2525
/*! exports provided: AutoFocusInside, MoveFocusInside, FreeFocusInside, InFocusGuard, FocusLockUI, useFocusInside, default */
2626

@@ -64,6 +64,8 @@
6464

6565
/*! exports provided: ComponentsListRenderer, default */
6666

67+
/*! exports provided: DEFAULT_CARET_POSITION, defaultScrollToItem, errorMessage, triggerPropsCheck */
68+
6769
/*! exports provided: DNS, URL, default */
6870

6971
/*! exports provided: DateSeparator */
@@ -124,14 +126,10 @@
124126

125127
/*! exports provided: InteractivityDisabler */
126128

127-
/*! exports provided: Item, default */
128-
129129
/*! exports provided: KEY_CODES, default */
130130

131131
/*! exports provided: LinkRenderer, default */
132132

133-
/*! exports provided: List, default */
134-
135133
/*! exports provided: ListRenderer, default */
136134

137135
/*! exports provided: LoadMoreButton, LoadMorePaginator */
@@ -244,7 +242,7 @@
244242

245243
/*! exports provided: channelReducer, initialState */
246244

247-
/*! exports provided: client, channel, channelContext, translationContext, channels, message, thread, threadMessages, messages, users, MessageMock */
245+
/*! exports provided: client, channel, thread, threadMessages, channelContext, translationContext, channels, message, messages, users, MessageMock */
248246

249247
/*! exports provided: columns, default */
250248

@@ -286,8 +284,6 @@
286284

287285
/*! exports provided: default, useStyleGuideContext */
288286

289-
/*! exports provided: defaultScrollToItem */
290-
291287
/*! exports provided: defaultTimestampFormat, notValidDateWarning, noParsingFunctionWarning, default */
292288

293289
/*! exports provided: deferAction, inlineProp */
@@ -510,7 +506,7 @@
510506

511507
/*! exports provided: useUserRole */
512508

513-
/*! exports provided: v1, v3, v4, v5, NIL, version, validate, stringify, parse */
509+
/*! exports provided: v1, v3, v4, v5 */
514510

515511
/*! exports provided: validateAndGetMessage, isUserMuted, MESSAGE_ACTIONS, getMessageActions, areMessagePropsEqual, shouldMessageComponentUpdate, messageHasReactions, messageHasAttachments, getImages, getNonImageAttachments, getReadByTooltipText, MessagePropTypes */
516512

@@ -2352,10 +2348,6 @@
23522348
!*** ./node_modules/uuid/dist/esm-browser/md5.js ***!
23532349
\***************************************************/
23542350

2355-
/*!***************************************************!*\
2356-
!*** ./node_modules/uuid/dist/esm-browser/nil.js ***!
2357-
\***************************************************/
2358-
23592351
/*!***************************************************!*\
23602352
!*** ./node_modules/uuid/dist/esm-browser/rng.js ***!
23612353
\***************************************************/
@@ -2676,14 +2668,6 @@
26762668
!*** ./node_modules/uuid/dist/esm-browser/index.js ***!
26772669
\*****************************************************/
26782670

2679-
/*!*****************************************************!*\
2680-
!*** ./node_modules/uuid/dist/esm-browser/parse.js ***!
2681-
\*****************************************************/
2682-
2683-
/*!*****************************************************!*\
2684-
!*** ./node_modules/uuid/dist/esm-browser/regex.js ***!
2685-
\*****************************************************/
2686-
26872671
/*!*****************************************************!*\
26882672
!*** ./src/components/Attachment/FileAttachment.js ***!
26892673
\*****************************************************/
@@ -2980,10 +2964,6 @@
29802964
!*** ./node_modules/use-sidecar/dist/es2015/index.js ***!
29812965
\*******************************************************/
29822966

2983-
/*!*******************************************************!*\
2984-
!*** ./node_modules/uuid/dist/esm-browser/version.js ***!
2985-
\*******************************************************/
2986-
29872967
/*!*******************************************************!*\
29882968
!*** ./src/assets/Poweredby_100px-White_VertText.png ***!
29892969
\*******************************************************/
@@ -3160,10 +3140,6 @@
31603140
!*** ./node_modules/use-sidecar/dist/es2015/medium.js ***!
31613141
\********************************************************/
31623142

3163-
/*!********************************************************!*\
3164-
!*** ./node_modules/uuid/dist/esm-browser/validate.js ***!
3165-
\********************************************************/
3166-
31673143
/*!********************************************************!*\
31683144
!*** ./src/components/Attachment/AttachmentActions.js ***!
31693145
\********************************************************/
@@ -3352,10 +3328,6 @@
33523328
!*** ./node_modules/use-sidecar/dist/es2015/exports.js ***!
33533329
\*********************************************************/
33543330

3355-
/*!*********************************************************!*\
3356-
!*** ./node_modules/uuid/dist/esm-browser/stringify.js ***!
3357-
\*********************************************************/
3358-
33593331
/*!*********************************************************!*\
33603332
!*** ./src/components/AutoCompleteTextarea/Textarea.js ***!
33613333
\*********************************************************/
@@ -3692,6 +3664,10 @@
36923664
!*** ./node_modules/react-view-pager/lib/PagerElement.js ***!
36933665
\***********************************************************/
36943666

3667+
/*!***********************************************************!*\
3668+
!*** ./node_modules/uuid/dist/esm-browser/bytesToUuid.js ***!
3669+
\***********************************************************/
3670+
36953671
/*!***********************************************************!*\
36963672
!*** ./src/components/MessageInput/MessageInputSimple.js ***!
36973673
\***********************************************************/

docs/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@
99
</head>
1010
<body>
1111
<div id="rsg-root"></div>
12-
<script src="build/bundle.7737a136.js"></script>
12+
<script src="build/bundle.571d5957.js"></script>
1313
</body>
1414
</html>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "stream-chat-react",
3-
"version": "3.4.5",
3+
"version": "3.4.6",
44
"description": "React components to create chat conversations or livestream style chat",
55
"author": "GetStream",
66
"homepage": "https://getstream.io/chat/",

src/components/ChannelList/ChannelList.js

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ const ChannelList = (props) => {
121121
useMobileNavigation(channelListRef, navOpen, closeMobileNav);
122122

123123
// All the event listeners
124-
useMessageNewListener(setChannels, props.lockChannelOrder);
124+
useMessageNewListener(
125+
setChannels,
126+
props.lockChannelOrder,
127+
props.allowNewMessagesFromUnfilteredChannels,
128+
);
125129
useNotificationMessageNewListener(setChannels, props.onMessageNew);
126130
useNotificationAddedToChannelListener(setChannels, props.onAddedToChannel);
127131
useNotificationRemovedFromChannelListener(
@@ -381,6 +385,18 @@ ChannelList.propTypes = {
381385
* If true, channels won't be dynamically sorted by most recent message.
382386
*/
383387
lockChannelOrder: PropTypes.bool,
388+
/**
389+
* When client receives an event `message.new`, we push that channel to top of the list.
390+
*
391+
* But If the channel doesn't exist in the list, then we get the channel from client
392+
* (client maintains list of watched channels as `client.activeChannels`) and push
393+
* that channel to top of the list by default. You can disallow this behavior by setting following
394+
* prop to false. This is quite usefull where you have multiple tab structure and you don't want
395+
* ChannelList in Tab1 to react to new message on some channel in Tab2.
396+
*
397+
* Default value is true.
398+
*/
399+
allowNewMessagesFromUnfilteredChannels: PropTypes.bool,
384400
};
385401

386402
export default React.memo(ChannelList);

src/components/ChannelList/hooks/useMessageNewListener.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { moveChannelUp } from '../utils';
1414
export const useMessageNewListener = (
1515
setChannels,
1616
lockChannelOrder = false,
17+
allowNewMessagesFromUnfilteredChannels = true,
1718
) => {
1819
const { client } = useContext(ChatContext);
1920
useEffect(() => {
@@ -22,7 +23,7 @@ export const useMessageNewListener = (
2223
setChannels((channels) => {
2324
const channelInList =
2425
channels.filter((c) => c.cid === e.cid).length > 0;
25-
if (!channelInList) {
26+
if (!channelInList && allowNewMessagesFromUnfilteredChannels) {
2627
// @ts-ignore
2728
const channel = client.channel(e.channel_type, e.channel_id);
2829
return uniqBy([channel, ...channels], 'cid');

types/index.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,18 @@ export interface ChannelListProps {
275275
List?: React.ElementType<ChannelListUIComponentProps>;
276276
Paginator?: React.ElementType<PaginatorProps>;
277277
lockChannelOrder?: boolean;
278+
/**
279+
* When client receives an event `message.new`, we push that channel to top of the list.
280+
*
281+
* But If the channel doesn't exist in the list, then we get the channel from client
282+
* (client maintains list of watched channels as `client.activeChannels`) and push
283+
* that channel to top of the list by default. You can disallow this behavior by setting following
284+
* prop to false. This is quite usefull where you have multiple tab structure and you don't want
285+
* ChannelList in Tab1 to react to new message on some channel in Tab2.
286+
*
287+
* Default value is true.
288+
*/
289+
allowNewMessagesFromUnfilteredChannels?: boolean;
278290
onMessageNew?(
279291
thisArg: React.Dispatch<React.SetStateAction<Client.Channel[]>>,
280292
e: Client.Event,

0 commit comments

Comments
 (0)