stream-chat-react 12.15.5 → 12.15.7
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.
- package/dist/components/Channel/Channel.js +1 -0
- package/dist/components/ChannelList/hooks/useChannelListShape.js +3 -3
- package/dist/components/Chat/hooks/useChat.js +1 -1
- package/dist/components/MessageList/VirtualizedMessageListComponents.d.ts +1 -1
- package/dist/components/MessageList/VirtualizedMessageListComponents.js +4 -0
- package/dist/css/v2/index.css +1 -1
- package/dist/css/v2/index.layout.css +1 -1
- package/dist/index.browser.cjs +8 -5
- package/dist/index.browser.cjs.map +2 -2
- package/dist/index.node.cjs +8 -5
- package/dist/index.node.cjs.map +2 -2
- package/dist/scss/v2/Message/Message-layout.scss +2 -1
- package/package.json +2 -2
|
@@ -72,6 +72,7 @@ const ChannelInner = (props) => {
|
|
|
72
72
|
...initialState,
|
|
73
73
|
hasMore: channel.state.messagePagination.hasPrev,
|
|
74
74
|
loading: !channel.initialized,
|
|
75
|
+
messages: channel.state.messages,
|
|
75
76
|
});
|
|
76
77
|
const jumpToMessageFromSearch = useSearchFocusedMessage();
|
|
77
78
|
const isMounted = useIsMounted();
|
|
@@ -163,13 +163,13 @@ export const useChannelListShapeDefaults = () => {
|
|
|
163
163
|
if (typeof customHandler === 'function') {
|
|
164
164
|
return customHandler(setChannels, event);
|
|
165
165
|
}
|
|
166
|
-
if (!event.
|
|
166
|
+
if (!event.channel_id && !event.channel_type) {
|
|
167
167
|
return;
|
|
168
168
|
}
|
|
169
169
|
const channel = await getChannel({
|
|
170
170
|
client,
|
|
171
|
-
id: event.
|
|
172
|
-
type: event.
|
|
171
|
+
id: event.channel_id,
|
|
172
|
+
type: event.channel_type,
|
|
173
173
|
});
|
|
174
174
|
const considerArchivedChannels = shouldConsiderArchivedChannels(filters);
|
|
175
175
|
if (isChannelArchived(channel) && considerArchivedChannels && !filters.archived) {
|
|
@@ -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 = "12.15.
|
|
27
|
+
const version = "12.15.7";
|
|
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'
|
|
@@ -12,6 +12,6 @@ type CommonVirtuosoComponentProps<StreamChatGenerics extends DefaultStreamChatGe
|
|
|
12
12
|
};
|
|
13
13
|
export declare const Item: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ context, ...props }: ItemProps & CommonVirtuosoComponentProps<StreamChatGenerics>) => React.JSX.Element;
|
|
14
14
|
export declare const Header: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ context, }: CommonVirtuosoComponentProps<StreamChatGenerics>) => React.JSX.Element;
|
|
15
|
-
export declare const EmptyPlaceholder: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ context, }: CommonVirtuosoComponentProps<StreamChatGenerics>) => React.JSX.Element;
|
|
15
|
+
export declare const EmptyPlaceholder: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>({ context, }: CommonVirtuosoComponentProps<StreamChatGenerics>) => React.JSX.Element | null;
|
|
16
16
|
export declare const messageRenderer: <StreamChatGenerics extends DefaultStreamChatGenerics = DefaultStreamChatGenerics>(virtuosoIndex: number, _data: UnknownType, virtuosoContext: VirtuosoContext<StreamChatGenerics>) => React.JSX.Element | null;
|
|
17
17
|
export {};
|
|
@@ -44,6 +44,10 @@ export const Header = ({ context, }) => {
|
|
|
44
44
|
};
|
|
45
45
|
export const EmptyPlaceholder = ({ context, }) => {
|
|
46
46
|
const { EmptyStateIndicator = DefaultEmptyStateIndicator } = useComponentContext('VirtualizedMessageList');
|
|
47
|
+
// prevent showing that there are no messages if there actually are messages (for some reason virtuoso decides to render empty placeholder first, even though it has the totalCount prop > 0)
|
|
48
|
+
if (typeof context?.processedMessages !== 'undefined' &&
|
|
49
|
+
context.processedMessages.length > 0)
|
|
50
|
+
return null;
|
|
47
51
|
return (React.createElement(React.Fragment, null, EmptyStateIndicator && (React.createElement(EmptyStateIndicator, { listType: context?.threadList ? 'thread' : 'message' }))));
|
|
48
52
|
};
|
|
49
53
|
export const messageRenderer = (virtuosoIndex, _data, virtuosoContext) => {
|