stream-chat-react-native-core 4.3.0-beta.4 → 4.3.0-beta.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.
- package/lib/commonjs/components/Attachment/Attachment.js +21 -12
- package/lib/commonjs/components/Attachment/Attachment.js.map +1 -1
- package/lib/commonjs/components/Channel/Channel.js +15 -13
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js +2 -0
- package/lib/commonjs/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/commonjs/components/Message/Message.js +11 -8
- package/lib/commonjs/components/Message/Message.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js +28 -23
- package/lib/commonjs/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js +7 -6
- package/lib/commonjs/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js +2 -2
- package/lib/commonjs/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Attachment/Attachment.js +21 -12
- package/lib/module/components/Attachment/Attachment.js.map +1 -1
- package/lib/module/components/Channel/Channel.js +15 -13
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js +2 -0
- package/lib/module/components/Channel/hooks/useCreateMessagesContext.js.map +1 -1
- package/lib/module/components/Message/Message.js +11 -8
- package/lib/module/components/Message/Message.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageContent.js +28 -23
- package/lib/module/components/Message/MessageSimple/MessageContent.js.map +1 -1
- package/lib/module/components/Message/MessageSimple/MessageSimple.js +7 -6
- package/lib/module/components/Message/MessageSimple/MessageSimple.js.map +1 -1
- package/lib/module/contexts/messagesContext/MessagesContext.js +2 -2
- package/lib/module/contexts/messagesContext/MessagesContext.js.map +1 -1
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Attachment/Attachment.d.ts +2 -2
- package/lib/typescript/components/Channel/Channel.d.ts +1 -1
- package/lib/typescript/components/Channel/hooks/useCreateMessagesContext.d.ts +1 -1
- package/lib/typescript/components/Message/Message.d.ts +1 -1
- package/lib/typescript/components/Message/MessageSimple/MessageContent.d.ts +1 -1
- package/lib/typescript/contexts/messagesContext/MessagesContext.d.ts +2 -0
- package/package.json +1 -1
- package/src/components/Attachment/Attachment.tsx +11 -2
- package/src/components/Channel/Channel.tsx +3 -0
- package/src/components/Channel/__tests__/isAttachmentEqualHandler.test.js +100 -0
- package/src/components/Channel/hooks/useCreateMessagesContext.ts +2 -0
- package/src/components/Message/Message.tsx +19 -8
- package/src/components/Message/MessageSimple/MessageContent.tsx +23 -14
- package/src/components/Message/MessageSimple/MessageSimple.tsx +14 -11
- package/src/contexts/messagesContext/MessagesContext.tsx +5 -0
- package/src/version.json +1 -1
|
@@ -26,6 +26,7 @@ export type AttachmentPropsWithContext<
|
|
|
26
26
|
| 'Gallery'
|
|
27
27
|
| 'giphyVersion'
|
|
28
28
|
| 'Giphy'
|
|
29
|
+
| 'isAttachmentEqual'
|
|
29
30
|
| 'UrlPreview'
|
|
30
31
|
> & {
|
|
31
32
|
/**
|
|
@@ -101,15 +102,20 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
101
102
|
prevProps: AttachmentPropsWithContext<StreamChatGenerics>,
|
|
102
103
|
nextProps: AttachmentPropsWithContext<StreamChatGenerics>,
|
|
103
104
|
) => {
|
|
104
|
-
const { attachment: prevAttachment } = prevProps;
|
|
105
|
+
const { attachment: prevAttachment, isAttachmentEqual } = prevProps;
|
|
105
106
|
const { attachment: nextAttachment } = nextProps;
|
|
106
107
|
|
|
107
108
|
const attachmentEqual =
|
|
108
109
|
prevAttachment.actions?.length === nextAttachment.actions?.length &&
|
|
109
110
|
prevAttachment.image_url === nextAttachment.image_url &&
|
|
110
111
|
prevAttachment.thumb_url === nextAttachment.thumb_url;
|
|
112
|
+
if (!attachmentEqual) return false;
|
|
111
113
|
|
|
112
|
-
|
|
114
|
+
if (isAttachmentEqual) {
|
|
115
|
+
return isAttachmentEqual(prevAttachment, nextAttachment);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
return true;
|
|
113
119
|
};
|
|
114
120
|
|
|
115
121
|
const MemoizedAttachment = React.memo(
|
|
@@ -129,6 +135,7 @@ export type AttachmentProps<
|
|
|
129
135
|
| 'Giphy'
|
|
130
136
|
| 'giphyVersion'
|
|
131
137
|
| 'UrlPreview'
|
|
138
|
+
| 'isAttachmentEqual'
|
|
132
139
|
>
|
|
133
140
|
> &
|
|
134
141
|
Pick<AttachmentPropsWithContext<StreamChatGenerics>, 'attachment'>;
|
|
@@ -159,6 +166,7 @@ export const Attachment = <
|
|
|
159
166
|
Gallery: ContextGallery,
|
|
160
167
|
Giphy: ContextGiphy,
|
|
161
168
|
giphyVersion: ContextGiphyVersion,
|
|
169
|
+
isAttachmentEqual,
|
|
162
170
|
UrlPreview: ContextUrlPreview,
|
|
163
171
|
} = useMessagesContext<StreamChatGenerics>();
|
|
164
172
|
|
|
@@ -185,6 +193,7 @@ export const Attachment = <
|
|
|
185
193
|
Gallery,
|
|
186
194
|
Giphy,
|
|
187
195
|
giphyVersion,
|
|
196
|
+
isAttachmentEqual,
|
|
188
197
|
UrlPreview,
|
|
189
198
|
}}
|
|
190
199
|
/>
|
|
@@ -255,6 +255,7 @@ export type ChannelPropsWithContext<
|
|
|
255
255
|
| 'handleThreadReply'
|
|
256
256
|
| 'InlineDateSeparator'
|
|
257
257
|
| 'InlineUnreadIndicator'
|
|
258
|
+
| 'isAttachmentEqual'
|
|
258
259
|
| 'legacyImageViewerSwipeBehaviour'
|
|
259
260
|
| 'markdownRules'
|
|
260
261
|
| 'Message'
|
|
@@ -458,6 +459,7 @@ const ChannelWithContext = <
|
|
|
458
459
|
InputEditingStateHeader = InputEditingStateHeaderDefault,
|
|
459
460
|
InputGiphySearch = InputGiphyCommandInputDefault,
|
|
460
461
|
InputReplyStateHeader = InputReplyStateHeaderDefault,
|
|
462
|
+
isAttachmentEqual,
|
|
461
463
|
keyboardBehavior,
|
|
462
464
|
KeyboardCompatibleView = KeyboardCompatibleViewDefault,
|
|
463
465
|
keyboardVerticalOffset,
|
|
@@ -1698,6 +1700,7 @@ const ChannelWithContext = <
|
|
|
1698
1700
|
initialScrollToFirstUnreadMessage,
|
|
1699
1701
|
InlineDateSeparator,
|
|
1700
1702
|
InlineUnreadIndicator,
|
|
1703
|
+
isAttachmentEqual,
|
|
1701
1704
|
legacyImageViewerSwipeBehaviour,
|
|
1702
1705
|
markdownRules,
|
|
1703
1706
|
Message,
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
import { Text } from 'react-native';
|
|
4
|
+
|
|
5
|
+
import { act, cleanup, render, waitFor } from '@testing-library/react-native';
|
|
6
|
+
|
|
7
|
+
import { OverlayProvider } from '../../../contexts/overlayContext/OverlayProvider';
|
|
8
|
+
import { getOrCreateChannelApi } from '../../../mock-builders/api/getOrCreateChannel';
|
|
9
|
+
|
|
10
|
+
import { useMockedApis } from '../../../mock-builders/api/useMockedApis';
|
|
11
|
+
import dispatchMessageUpdateEvent from '../../../mock-builders/event/messageUpdated';
|
|
12
|
+
import { generateChannelResponse } from '../../../mock-builders/generator/channel';
|
|
13
|
+
import { generateMember } from '../../../mock-builders/generator/member';
|
|
14
|
+
import { generateMessage } from '../../../mock-builders/generator/message';
|
|
15
|
+
import { generateUser } from '../../../mock-builders/generator/user';
|
|
16
|
+
import { getTestClientWithUser } from '../../../mock-builders/mock';
|
|
17
|
+
import { Channel } from '../../Channel/Channel';
|
|
18
|
+
import { Chat } from '../../Chat/Chat';
|
|
19
|
+
import { MessageList } from '../../MessageList/MessageList';
|
|
20
|
+
|
|
21
|
+
describe('Message', () => {
|
|
22
|
+
let channel;
|
|
23
|
+
let chatClient;
|
|
24
|
+
|
|
25
|
+
const user = generateUser({ id: 'id', name: 'name' });
|
|
26
|
+
const messages = [
|
|
27
|
+
generateMessage({
|
|
28
|
+
attachments: [{ customField: 'custom-field', type: 'test' }],
|
|
29
|
+
user,
|
|
30
|
+
}),
|
|
31
|
+
];
|
|
32
|
+
|
|
33
|
+
beforeEach(async () => {
|
|
34
|
+
const members = [generateMember({ user })];
|
|
35
|
+
const mockedChannel = generateChannelResponse({
|
|
36
|
+
members,
|
|
37
|
+
messages,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
chatClient = await getTestClientWithUser(user);
|
|
41
|
+
useMockedApis(chatClient, [getOrCreateChannelApi(mockedChannel)]);
|
|
42
|
+
channel = chatClient.channel('messaging', mockedChannel.id);
|
|
43
|
+
await channel.watch();
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
afterEach(() => {
|
|
47
|
+
jest.clearAllMocks();
|
|
48
|
+
cleanup();
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
const getMessageWithCustomFields = () => {
|
|
52
|
+
const isAttachmentEqualHandler = (prevProps, nextProps) => {
|
|
53
|
+
const propsEqual = prevProps.customField === nextProps.customField;
|
|
54
|
+
if (!propsEqual) return false;
|
|
55
|
+
return true;
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
return (
|
|
59
|
+
<OverlayProvider>
|
|
60
|
+
<Chat client={chatClient}>
|
|
61
|
+
<Channel
|
|
62
|
+
Card={({ customField, type }) => {
|
|
63
|
+
if (type === 'test') {
|
|
64
|
+
return <Text testID='attachment-custom-field'>{customField}</Text>;
|
|
65
|
+
}
|
|
66
|
+
}}
|
|
67
|
+
channel={channel}
|
|
68
|
+
isAttachmentEqual={isAttachmentEqualHandler}
|
|
69
|
+
>
|
|
70
|
+
<MessageList />
|
|
71
|
+
</Channel>
|
|
72
|
+
</Chat>
|
|
73
|
+
</OverlayProvider>
|
|
74
|
+
);
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
it('should render attachment with custom field', async () => {
|
|
78
|
+
const { getByText } = render(getMessageWithCustomFields());
|
|
79
|
+
|
|
80
|
+
await waitFor(() => {
|
|
81
|
+
expect(getByText('custom-field')).toBeTruthy();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
act(() => {
|
|
85
|
+
dispatchMessageUpdateEvent(
|
|
86
|
+
chatClient,
|
|
87
|
+
{
|
|
88
|
+
...messages[0],
|
|
89
|
+
attachments: [{ customField: 'custom-field-2', type: 'test' }],
|
|
90
|
+
updated_at: new Date(),
|
|
91
|
+
},
|
|
92
|
+
channel,
|
|
93
|
+
);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
await waitFor(() => {
|
|
97
|
+
expect(getByText('custom-field-2')).toBeTruthy();
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
});
|
|
@@ -42,6 +42,7 @@ export const useCreateMessagesContext = <
|
|
|
42
42
|
initialScrollToFirstUnreadMessage,
|
|
43
43
|
InlineDateSeparator,
|
|
44
44
|
InlineUnreadIndicator,
|
|
45
|
+
isAttachmentEqual,
|
|
45
46
|
legacyImageViewerSwipeBehaviour,
|
|
46
47
|
markdownRules,
|
|
47
48
|
Message,
|
|
@@ -127,6 +128,7 @@ export const useCreateMessagesContext = <
|
|
|
127
128
|
initialScrollToFirstUnreadMessage,
|
|
128
129
|
InlineDateSeparator,
|
|
129
130
|
InlineUnreadIndicator,
|
|
131
|
+
isAttachmentEqual,
|
|
130
132
|
legacyImageViewerSwipeBehaviour,
|
|
131
133
|
markdownRules,
|
|
132
134
|
Message,
|
|
@@ -112,6 +112,7 @@ export type MessagePropsWithContext<
|
|
|
112
112
|
| 'handleReaction'
|
|
113
113
|
| 'handleRetry'
|
|
114
114
|
| 'handleThreadReply'
|
|
115
|
+
| 'isAttachmentEqual'
|
|
115
116
|
| 'messageActions'
|
|
116
117
|
| 'messageContentOrder'
|
|
117
118
|
| 'MessageSimple'
|
|
@@ -472,6 +473,7 @@ const MessageWithContext = <
|
|
|
472
473
|
t,
|
|
473
474
|
updateMessage,
|
|
474
475
|
});
|
|
476
|
+
|
|
475
477
|
const showMessageOverlay = async (messageReactions = false, error = errorOrFailed) => {
|
|
476
478
|
await dismissKeyboard();
|
|
477
479
|
|
|
@@ -680,6 +682,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
680
682
|
) => {
|
|
681
683
|
const {
|
|
682
684
|
goToMessage: prevGoToMessage,
|
|
685
|
+
isAttachmentEqual,
|
|
683
686
|
isTargetedMessage: prevIsTargetedMessage,
|
|
684
687
|
lastReceivedId: prevLastReceivedId,
|
|
685
688
|
members: prevMembers,
|
|
@@ -729,8 +732,8 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
729
732
|
prevMessage.status === nextMessage.status &&
|
|
730
733
|
prevMessage.type === nextMessage.type &&
|
|
731
734
|
prevMessage.text === nextMessage.text &&
|
|
732
|
-
prevMessage.
|
|
733
|
-
prevMessage.
|
|
735
|
+
prevMessage.pinned === nextMessage.pinned &&
|
|
736
|
+
prevMessage.updated_at === nextMessage.updated_at;
|
|
734
737
|
|
|
735
738
|
if (!messageEqual) return false;
|
|
736
739
|
|
|
@@ -752,12 +755,20 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
752
755
|
(Array.isArray(prevMessageAttachments) &&
|
|
753
756
|
Array.isArray(nextMessageAttachments) &&
|
|
754
757
|
prevMessageAttachments.length === nextMessageAttachments.length &&
|
|
755
|
-
prevMessageAttachments.every((attachment, index) =>
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
attachment.
|
|
759
|
-
|
|
760
|
-
|
|
758
|
+
prevMessageAttachments.every((attachment, index) => {
|
|
759
|
+
const attachmentKeysEqual =
|
|
760
|
+
attachment.type === 'image'
|
|
761
|
+
? attachment.image_url === nextMessageAttachments[index].image_url &&
|
|
762
|
+
attachment.thumb_url === nextMessageAttachments[index].thumb_url
|
|
763
|
+
: attachment.type === nextMessageAttachments[index].type;
|
|
764
|
+
|
|
765
|
+
if (isAttachmentEqual)
|
|
766
|
+
return (
|
|
767
|
+
attachmentKeysEqual && !!isAttachmentEqual(attachment, nextMessageAttachments[index])
|
|
768
|
+
);
|
|
769
|
+
|
|
770
|
+
return attachmentKeysEqual;
|
|
771
|
+
})) ||
|
|
761
772
|
prevMessageAttachments === nextMessageAttachments;
|
|
762
773
|
if (!attachmentsEqual) return false;
|
|
763
774
|
|
|
@@ -84,6 +84,7 @@ export type MessageContentPropsWithContext<
|
|
|
84
84
|
| 'FileAttachmentGroup'
|
|
85
85
|
| 'formatDate'
|
|
86
86
|
| 'Gallery'
|
|
87
|
+
| 'isAttachmentEqual'
|
|
87
88
|
| 'MessageFooter'
|
|
88
89
|
| 'MessageHeader'
|
|
89
90
|
| 'MessageDeleted'
|
|
@@ -371,6 +372,7 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
371
372
|
goToMessage: prevGoToMessage,
|
|
372
373
|
groupStyles: prevGroupStyles,
|
|
373
374
|
hasReactions: prevHasReactions,
|
|
375
|
+
isAttachmentEqual,
|
|
374
376
|
lastGroupMessage: prevLastGroupMessage,
|
|
375
377
|
members: prevMembers,
|
|
376
378
|
message: prevMessage,
|
|
@@ -402,7 +404,6 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
402
404
|
|
|
403
405
|
const goToMessageChangedAndMatters =
|
|
404
406
|
nextMessage.quoted_message_id && prevGoToMessage !== nextGoToMessage;
|
|
405
|
-
|
|
406
407
|
if (goToMessageChangedAndMatters) return false;
|
|
407
408
|
|
|
408
409
|
const onlyEmojisEqual = prevOnlyEmojis === nextOnlyEmojis;
|
|
@@ -431,7 +432,6 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
431
432
|
prevMessage.type === nextMessage.type &&
|
|
432
433
|
prevMessage.text === nextMessage.text &&
|
|
433
434
|
prevMessage.pinned === nextMessage.pinned;
|
|
434
|
-
|
|
435
435
|
if (!messageEqual) return false;
|
|
436
436
|
|
|
437
437
|
const isPrevQuotedMessageTypeDeleted = prevMessage.quoted_message?.type === 'deleted';
|
|
@@ -440,21 +440,28 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
440
440
|
const quotedMessageEqual =
|
|
441
441
|
prevMessage.quoted_message?.id === nextMessage.quoted_message?.id &&
|
|
442
442
|
isPrevQuotedMessageTypeDeleted === isNextQuotedMessageTypeDeleted;
|
|
443
|
-
|
|
444
443
|
if (!quotedMessageEqual) return false;
|
|
445
444
|
|
|
446
|
-
const
|
|
447
|
-
const
|
|
445
|
+
const prevMessageAttachments = prevMessage.attachments;
|
|
446
|
+
const nextMessageAttachments = nextMessage.attachments;
|
|
448
447
|
const attachmentsEqual =
|
|
449
|
-
Array.isArray(
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
448
|
+
Array.isArray(prevMessageAttachments) &&
|
|
449
|
+
Array.isArray(nextMessageAttachments) &&
|
|
450
|
+
prevMessageAttachments.length === nextMessageAttachments.length &&
|
|
451
|
+
prevMessageAttachments.every((attachment, index) => {
|
|
452
|
+
const attachmentKeysEqual =
|
|
453
|
+
attachment.type === 'image'
|
|
454
|
+
? attachment.image_url === nextMessageAttachments[index].image_url &&
|
|
455
|
+
attachment.thumb_url === nextMessageAttachments[index].thumb_url
|
|
456
|
+
: attachment.type === nextMessageAttachments[index].type;
|
|
457
|
+
|
|
458
|
+
if (isAttachmentEqual)
|
|
459
|
+
return (
|
|
460
|
+
attachmentKeysEqual && !!isAttachmentEqual(attachment, nextMessageAttachments[index])
|
|
461
|
+
);
|
|
462
|
+
|
|
463
|
+
return attachmentKeysEqual;
|
|
464
|
+
});
|
|
458
465
|
if (!attachmentsEqual) return false;
|
|
459
466
|
|
|
460
467
|
const latestReactionsEqual =
|
|
@@ -527,6 +534,7 @@ export const MessageContent = <
|
|
|
527
534
|
FileAttachmentGroup,
|
|
528
535
|
formatDate,
|
|
529
536
|
Gallery,
|
|
537
|
+
isAttachmentEqual,
|
|
530
538
|
MessageDeleted,
|
|
531
539
|
MessageFooter,
|
|
532
540
|
MessageHeader,
|
|
@@ -549,6 +557,7 @@ export const MessageContent = <
|
|
|
549
557
|
goToMessage,
|
|
550
558
|
groupStyles,
|
|
551
559
|
hasReactions,
|
|
560
|
+
isAttachmentEqual,
|
|
552
561
|
isMyMessage,
|
|
553
562
|
lastGroupMessage,
|
|
554
563
|
lastReceivedId,
|
|
@@ -144,18 +144,21 @@ const areEqual = <StreamChatGenerics extends DefaultStreamChatGenerics = Default
|
|
|
144
144
|
const channelEqual = prevChannel?.state.messages.length === nextChannel?.state.messages.length;
|
|
145
145
|
if (!channelEqual) return false;
|
|
146
146
|
|
|
147
|
-
const
|
|
148
|
-
const
|
|
147
|
+
const prevMessageAttachments = prevMessage.attachments;
|
|
148
|
+
const nextMessageAttachments = nextMessage.attachments;
|
|
149
149
|
const attachmentsEqual =
|
|
150
|
-
Array.isArray(
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
150
|
+
Array.isArray(prevMessageAttachments) &&
|
|
151
|
+
Array.isArray(nextMessageAttachments) &&
|
|
152
|
+
prevMessageAttachments.length === nextMessageAttachments.length &&
|
|
153
|
+
prevMessageAttachments.every((attachment, index) => {
|
|
154
|
+
const attachmentKeysEqual =
|
|
155
|
+
attachment.type === 'image'
|
|
156
|
+
? attachment.image_url === nextMessageAttachments[index].image_url &&
|
|
157
|
+
attachment.thumb_url === nextMessageAttachments[index].thumb_url
|
|
158
|
+
: attachment.type === nextMessageAttachments[index].type;
|
|
159
|
+
|
|
160
|
+
return attachmentKeysEqual;
|
|
161
|
+
});
|
|
159
162
|
if (!attachmentsEqual) return false;
|
|
160
163
|
|
|
161
164
|
const latestReactionsEqual =
|
|
@@ -296,6 +296,11 @@ export type MessagesContextValue<
|
|
|
296
296
|
handleRetry?: (message: MessageType<StreamChatGenerics>) => Promise<void>;
|
|
297
297
|
/** Handler to access when a thread reply action is invoked */
|
|
298
298
|
handleThreadReply?: (message: MessageType<StreamChatGenerics>) => Promise<void>;
|
|
299
|
+
/** Handler to deal with custom memoization logic of Attachment */
|
|
300
|
+
isAttachmentEqual?: (
|
|
301
|
+
prevAttachment: Attachment<StreamChatGenerics>,
|
|
302
|
+
nextAttachment: Attachment<StreamChatGenerics>,
|
|
303
|
+
) => boolean;
|
|
299
304
|
legacyImageViewerSwipeBehaviour?: boolean;
|
|
300
305
|
/** Object specifying rules defined within simple-markdown https://github.com/Khan/simple-markdown#adding-a-simple-extension */
|
|
301
306
|
markdownRules?: MarkdownRules;
|
package/src/version.json
CHANGED