Skip to content

Commit a04df26

Browse files
committed
Merge branch 'master' into feat/live-location-manager-and-attachments
# Conflicts: # src/mock-builders/generator/channel.ts
2 parents cd7d9fe + 323a438 commit a04df26

File tree

24 files changed

+317
-90
lines changed

24 files changed

+317
-90
lines changed

CHANGELOG.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,24 @@
1+
## [13.2.3](https://github.com/GetStream/stream-chat-react/compare/v13.2.2...v13.2.3) (2025-07-15)
2+
3+
### Bug Fixes
4+
5+
* export MessageIsThreadReplyInChannelButtonIndicator ([#2774](https://github.com/GetStream/stream-chat-react/issues/2774)) ([a87f500](https://github.com/GetStream/stream-chat-react/commit/a87f500f12b836b38e9cf6cd97779cc01d3c1b29))
6+
* regenerate image preview URL on image attachment removal when editing a message ([#2775](https://github.com/GetStream/stream-chat-react/issues/2775)) ([2c7d3ce](https://github.com/GetStream/stream-chat-react/commit/2c7d3ce80137a265e51ab1c47d1ae6e833c21843))
7+
8+
## [13.2.2](https://github.com/GetStream/stream-chat-react/compare/v13.2.1...v13.2.2) (2025-07-11)
9+
10+
### Bug Fixes
11+
12+
* change MultipleAnswersField input element to type text ([#2761](https://github.com/GetStream/stream-chat-react/issues/2761)) ([a590629](https://github.com/GetStream/stream-chat-react/commit/a5906297ef7273342707721cdf8d815ddb360046))
13+
* distinguish non-submit form buttons ([#2769](https://github.com/GetStream/stream-chat-react/issues/2769)) ([bdc3c3e](https://github.com/GetStream/stream-chat-react/commit/bdc3c3e1f11fae635895308487b000b814c7de29))
14+
* ensure all message links are properly wrapped when sharing same root domain ([#2754](https://github.com/GetStream/stream-chat-react/issues/2754)) ([adeb0e7](https://github.com/GetStream/stream-chat-react/commit/adeb0e73144755ef3d81d84dfdbbaf665c7e7d1c))
15+
* focus textarea upon file input change event ([#2752](https://github.com/GetStream/stream-chat-react/issues/2752)) ([22e0702](https://github.com/GetStream/stream-chat-react/commit/22e0702e69ef5a69138813eb418e219d08843d3b))
16+
* forward error object to LoadingErrorIndicator in ChannelList ([#2768](https://github.com/GetStream/stream-chat-react/issues/2768)) ([c014b1f](https://github.com/GetStream/stream-chat-react/commit/c014b1f21682b75abf9f889bfedd29b71be3be48))
17+
* keep focused textarea when message composer state changes ([#2759](https://github.com/GetStream/stream-chat-react/issues/2759)) ([e6d5a7f](https://github.com/GetStream/stream-chat-react/commit/e6d5a7ffb411932668d2c310843e9e629340cba8))
18+
* make character composition possible in textarea ([#2762](https://github.com/GetStream/stream-chat-react/issues/2762)) ([bbe09e5](https://github.com/GetStream/stream-chat-react/commit/bbe09e53a009655aea2dfc801c926f4a21d97cef))
19+
* prevent querying thread draft when drafts are disabled ([#2767](https://github.com/GetStream/stream-chat-react/issues/2767)) ([ff43179](https://github.com/GetStream/stream-chat-react/commit/ff4317987ab3aeff74e03235cd3bc1d44881b4be))
20+
* prevent setting unread UI state for channel non-members ([#2757](https://github.com/GetStream/stream-chat-react/issues/2757)) ([952612a](https://github.com/GetStream/stream-chat-react/commit/952612a7c84bddcccb083afd18874bcb3a65cd8e))
21+
122
## [13.2.1](https://github.com/GetStream/stream-chat-react/compare/v13.2.0...v13.2.1) (2025-06-23)
223

324
### Chores

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
"emoji-mart": "^5.4.0",
143143
"react": "^19.0.0 || ^18.0.0 || ^17.0.0 || ^16.14.0",
144144
"react-dom": "^19.0.0 || ^18.0.0 || ^17.0.0 || ^16.14.0",
145-
"stream-chat": "^9.8.0"
145+
"stream-chat": "^9.10.1"
146146
},
147147
"peerDependenciesMeta": {
148148
"@breezystack/lamejs": {
@@ -236,7 +236,7 @@
236236
"react": "^19.0.0",
237237
"react-dom": "^19.0.0",
238238
"semantic-release": "^24.2.3",
239-
"stream-chat": "^9.8.0",
239+
"stream-chat": "^9.10.1",
240240
"ts-jest": "^29.2.5",
241241
"typescript": "^5.4.5",
242242
"typescript-eslint": "^8.17.0"

src/components/Attachment/AttachmentContainer.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -114,19 +114,19 @@ export const GalleryContainer = ({
114114
>([]);
115115

116116
useLayoutEffect(() => {
117-
if (
118-
imageElements.current &&
119-
imageElements.current.every((element) => !!element) &&
120-
imageAttachmentSizeHandler
121-
) {
122-
const newConfigurations: ImageAttachmentConfiguration[] = [];
123-
imageElements.current.forEach((element, i) => {
124-
const config = imageAttachmentSizeHandler(attachment.images[i], element);
125-
newConfigurations.push(config);
126-
});
127-
setAttachmentConfigurations(newConfigurations);
117+
if (!imageElements.current || !imageAttachmentSizeHandler) return;
118+
const newConfigurations: ImageAttachmentConfiguration[] = [];
119+
const nonNullImageElements = imageElements.current.filter((e) => !!e);
120+
if (nonNullImageElements.length < imageElements.current.length) {
121+
imageElements.current = nonNullImageElements;
128122
}
129-
}, [imageElements, imageAttachmentSizeHandler, attachment]);
123+
imageElements.current.forEach((element, i) => {
124+
if (!element) return;
125+
const config = imageAttachmentSizeHandler(attachment.images[i], element);
126+
newConfigurations.push(config);
127+
});
128+
setAttachmentConfigurations(newConfigurations);
129+
}, [imageAttachmentSizeHandler, attachment]);
130130

131131
const images = attachment.images.map((image, i) => ({
132132
...image,

src/components/Channel/Channel.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,9 @@ const ChannelInner = (
383383
);
384384
} else {
385385
const markReadResponse = await channel.markRead();
386-
if (updateChannelUiUnreadState && markReadResponse) {
386+
// markReadResponse.event can be null in case of a user that is not a member of a channel being marked read
387+
// in that case event is null and we should not set unread UI
388+
if (updateChannelUiUnreadState && markReadResponse?.event) {
387389
_setChannelUnreadUiState({
388390
last_read: lastRead.current,
389391
last_read_message_id: markReadResponse.event.last_read_message_id,

src/components/ChannelList/ChannelList.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import type { ChatContextValue } from '../../context';
4242
import type { ChannelAvatarProps } from '../Avatar';
4343
import type { TranslationContextValue } from '../../context/TranslationContext';
4444
import type { PaginatorProps } from '../../types/types';
45+
import type { LoadingErrorIndicatorProps } from '../Loading';
4546

4647
const DEFAULT_FILTERS = {};
4748
const DEFAULT_OPTIONS = {};
@@ -86,7 +87,7 @@ export type ChannelListProps = {
8687
/** Custom UI component to display the container for the queried channels, defaults to and accepts same props as: [ChannelListMessenger](https://github.com/GetStream/stream-chat-react/blob/master/src/components/ChannelList/ChannelListMessenger.tsx) */
8788
List?: React.ComponentType<ChannelListMessengerProps>;
8889
/** Custom UI component to display the loading error indicator, defaults to component that renders null */
89-
LoadingErrorIndicator?: React.ComponentType;
90+
LoadingErrorIndicator?: React.ComponentType<LoadingErrorIndicatorProps>;
9091
/** Custom UI component to display the loading state, defaults to and accepts same props as: [LoadingChannels](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/LoadingChannels.tsx) */
9192
LoadingIndicator?: React.ComponentType;
9293
/** When true, channels won't dynamically sort by most recent message */

src/components/ChannelList/ChannelListMessenger.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import type { APIErrorResponse, Channel, ErrorFromResponse } from 'stream-chat';
55
import { LoadingChannels } from '../Loading/LoadingChannels';
66
import { NullComponent } from '../UtilityComponents';
77
import { useTranslationContext } from '../../context';
8+
import type { LoadingErrorIndicatorProps } from '../Loading';
89

910
export type ChannelListMessengerProps = {
1011
/** Whether the channel query request returned an errored response */
@@ -14,7 +15,7 @@ export type ChannelListMessengerProps = {
1415
/** Whether the channels are currently loading */
1516
loading?: boolean;
1617
/** Custom UI component to display the loading error indicator, defaults to component that renders null */
17-
LoadingErrorIndicator?: React.ComponentType;
18+
LoadingErrorIndicator?: React.ComponentType<LoadingErrorIndicatorProps>;
1819
/** Custom UI component to display a loading indicator, defaults to and accepts same props as: [LoadingChannels](https://github.com/GetStream/stream-chat-react/blob/master/src/components/Loading/LoadingChannels.tsx) */
1920
LoadingIndicator?: React.ComponentType;
2021
/** Local state hook that resets the currently loaded channels */
@@ -37,7 +38,7 @@ export const ChannelListMessenger = (
3738
const { t } = useTranslationContext('ChannelListMessenger');
3839

3940
if (error) {
40-
return <LoadingErrorIndicator />;
41+
return <LoadingErrorIndicator error={error} />;
4142
}
4243

4344
if (loading) {

src/components/ChannelList/__tests__/ChannelList.test.js

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,28 @@ describe('ChannelList', () => {
354354
expect(results).toHaveNoViolations();
355355
});
356356

357+
it('provides the error object to LoadingErrorIndicator', async () => {
358+
useMockedApis(chatClient, [erroredPostApi()]);
359+
jest.spyOn(console, 'warn').mockImplementationOnce(() => null);
360+
361+
const LoadingErrorIndicator = (props) => <div>{props.error.message}</div>;
362+
363+
await act(async () => {
364+
await render(
365+
<Chat client={chatClient}>
366+
<ChannelList
367+
filters={{}}
368+
LoadingErrorIndicator={LoadingErrorIndicator}
369+
options={{ presence: true, state: true, watch: true }}
370+
Preview={ChannelPreviewComponent}
371+
/>
372+
</Chat>,
373+
);
374+
});
375+
376+
expect(screen.getByText('StreamChat error HTTP code: 500')).toBeInTheDocument();
377+
});
378+
357379
it('should render loading indicator before the first channel list load and on reload', async () => {
358380
const channelsQueryStatesHistory = [];
359381
const channelListMessengerLoadingHistory = [];

src/components/Dialog/FormDialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export const FormDialog = <
139139
<button
140140
className='str-chat__dialog__controls-button str-chat__dialog__controls-button--cancel'
141141
onClick={close}
142+
type='button'
142143
>
143144
{t('Cancel')}
144145
</button>

src/components/Loading/LoadingErrorIndicator.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { useTranslationContext } from '../../context/TranslationContext';
44

55
export type LoadingErrorIndicatorProps = {
66
/** Error object */
7-
error?: Error;
7+
error?: Error | null;
88
};
99

1010
/**

src/components/Message/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ export * from './hooks';
33
export * from './icons';
44
export * from './Message';
55
export * from './MessageDeleted';
6+
export * from './MessageIsThreadReplyInChannelButtonIndicator';
67
export * from './MessageOptions';
78
export * from './MessageRepliesCountButton';
89
export * from './MessageSimple';

0 commit comments

Comments
 (0)