stream-chat-react-native-core 5.26.0-beta.3 → 5.26.0-beta.4
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/Channel/Channel.js +56 -45
- package/lib/commonjs/components/Channel/Channel.js.map +1 -1
- package/lib/commonjs/components/Channel/hooks/useTargetedMessage.js +5 -0
- package/lib/commonjs/components/Channel/hooks/useTargetedMessage.js.map +1 -1
- package/lib/commonjs/i18n/en.json +1 -1
- package/lib/commonjs/i18n/es.json +51 -51
- package/lib/commonjs/i18n/fr.json +51 -51
- package/lib/commonjs/i18n/he.json +51 -51
- package/lib/commonjs/i18n/hi.json +51 -51
- package/lib/commonjs/i18n/it.json +51 -51
- package/lib/commonjs/i18n/ja.json +51 -51
- package/lib/commonjs/i18n/ko.json +51 -51
- package/lib/commonjs/i18n/nl.json +51 -51
- package/lib/commonjs/i18n/pt-BR.json +51 -51
- package/lib/commonjs/i18n/ru.json +51 -51
- package/lib/commonjs/i18n/tr.json +51 -51
- package/lib/commonjs/version.json +1 -1
- package/lib/module/components/Channel/Channel.js +56 -45
- package/lib/module/components/Channel/Channel.js.map +1 -1
- package/lib/module/components/Channel/hooks/useTargetedMessage.js +5 -0
- package/lib/module/components/Channel/hooks/useTargetedMessage.js.map +1 -1
- package/lib/module/i18n/en.json +1 -1
- package/lib/module/i18n/es.json +51 -51
- package/lib/module/i18n/fr.json +51 -51
- package/lib/module/i18n/he.json +51 -51
- package/lib/module/i18n/hi.json +51 -51
- package/lib/module/i18n/it.json +51 -51
- package/lib/module/i18n/ja.json +51 -51
- package/lib/module/i18n/ko.json +51 -51
- package/lib/module/i18n/nl.json +51 -51
- package/lib/module/i18n/pt-BR.json +51 -51
- package/lib/module/i18n/ru.json +51 -51
- package/lib/module/i18n/tr.json +51 -51
- package/lib/module/version.json +1 -1
- package/lib/typescript/components/Channel/hooks/useTargetedMessage.d.ts +1 -0
- package/lib/typescript/i18n/en.json +1 -1
- package/lib/typescript/i18n/es.json +51 -51
- package/lib/typescript/i18n/fr.json +51 -51
- package/lib/typescript/i18n/he.json +51 -51
- package/lib/typescript/i18n/hi.json +51 -51
- package/lib/typescript/i18n/it.json +51 -51
- package/lib/typescript/i18n/ja.json +51 -51
- package/lib/typescript/i18n/ko.json +51 -51
- package/lib/typescript/i18n/nl.json +51 -51
- package/lib/typescript/i18n/pt-BR.json +51 -51
- package/lib/typescript/i18n/ru.json +51 -51
- package/lib/typescript/i18n/tr.json +51 -51
- package/package.json +1 -1
- package/src/components/Channel/Channel.tsx +41 -27
- package/src/components/Channel/hooks/useTargetedMessage.ts +6 -0
- package/src/i18n/en.json +1 -1
- package/src/i18n/es.json +51 -51
- package/src/i18n/fr.json +51 -51
- package/src/i18n/he.json +51 -51
- package/src/i18n/hi.json +51 -51
- package/src/i18n/it.json +51 -51
- package/src/i18n/ja.json +51 -51
- package/src/i18n/ko.json +51 -51
- package/src/i18n/nl.json +51 -51
- package/src/i18n/pt-BR.json +51 -51
- package/src/i18n/ru.json +51 -51
- package/src/i18n/tr.json +51 -51
- package/src/version.json +1 -1
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
{
|
|
2
|
-
"1 Reply": "",
|
|
3
|
-
"1 Thread Reply": "
|
|
4
|
-
"Allow access to your Gallery": "",
|
|
5
|
-
"Allow camera access in device settings": "",
|
|
2
|
+
"1 Reply": "1 Ответ",
|
|
3
|
+
"1 Thread Reply": "",
|
|
4
|
+
"Allow access to your Gallery": "Разрешить доступ к вашей галерее",
|
|
5
|
+
"Allow camera access in device settings": "Разрешите доступ к камере в настройках устройства.",
|
|
6
6
|
"Also send to channel": "",
|
|
7
|
-
"Are you sure you want to permanently delete this message?": "
|
|
8
|
-
"Are you sure?": "
|
|
9
|
-
"Block User": "
|
|
10
|
-
"Cancel": "
|
|
11
|
-
"Cannot Flag Message": "
|
|
12
|
-
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "
|
|
13
|
-
"Copy Message": "
|
|
14
|
-
"Delete": "
|
|
15
|
-
"Delete Message": "
|
|
16
|
-
"Device camera is used to take photos or videos.": "",
|
|
17
|
-
"Do you want to send a copy of this message to a moderator for further investigation?": "
|
|
18
|
-
"Edit Message": "
|
|
19
|
-
"Editing Message": "",
|
|
20
|
-
"Emoji matching": "",
|
|
7
|
+
"Are you sure you want to permanently delete this message?": "",
|
|
8
|
+
"Are you sure?": "",
|
|
9
|
+
"Block User": "",
|
|
10
|
+
"Cancel": "",
|
|
11
|
+
"Cannot Flag Message": "",
|
|
12
|
+
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
|
|
13
|
+
"Copy Message": "",
|
|
14
|
+
"Delete": "",
|
|
15
|
+
"Delete Message": "",
|
|
16
|
+
"Device camera is used to take photos or videos.": "Камера устройства используется для съемки фотографий или видео.",
|
|
17
|
+
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
18
|
+
"Edit Message": "",
|
|
19
|
+
"Editing Message": "Редактирование сообщения",
|
|
20
|
+
"Emoji matching": "Соответствие эмодзи",
|
|
21
21
|
"Empty message...": "",
|
|
22
22
|
"Error loading": "",
|
|
23
23
|
"Error loading channel list...": "",
|
|
24
24
|
"Error loading messages for this channel...": "",
|
|
25
25
|
"Error while loading, please reload/refresh": "",
|
|
26
|
-
"File type not supported": "",
|
|
27
|
-
"Flag": "
|
|
28
|
-
"Flag Message": "
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "
|
|
26
|
+
"File type not supported": "Тип файла не поддерживается",
|
|
27
|
+
"Flag": "",
|
|
28
|
+
"Flag Message": "",
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
30
30
|
"How about sending your first message to a friend?": "",
|
|
31
|
-
"Instant Commands": "",
|
|
31
|
+
"Instant Commands": "Мгновенные Команды",
|
|
32
32
|
"Let's start chatting!": "",
|
|
33
33
|
"Links are disabled": "",
|
|
34
34
|
"Loading channels...": "",
|
|
35
35
|
"Loading messages...": "",
|
|
36
36
|
"Loading...": "",
|
|
37
37
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
38
|
-
"Message Reactions": "
|
|
38
|
+
"Message Reactions": "",
|
|
39
39
|
"Message deleted": "",
|
|
40
|
-
"Message flagged": "
|
|
41
|
-
"Mute User": "
|
|
40
|
+
"Message flagged": "",
|
|
41
|
+
"Mute User": "",
|
|
42
42
|
"Not supported": "",
|
|
43
43
|
"Nothing yet...": "",
|
|
44
|
-
"Ok": "
|
|
45
|
-
"Only visible to you": "
|
|
46
|
-
"Open Settings": "",
|
|
47
|
-
"Photo": "",
|
|
48
|
-
"Photos and Videos": "",
|
|
49
|
-
"Pin to Conversation": "
|
|
44
|
+
"Ok": "",
|
|
45
|
+
"Only visible to you": "",
|
|
46
|
+
"Open Settings": "Открыть настройки",
|
|
47
|
+
"Photo": "Фото",
|
|
48
|
+
"Photos and Videos": "Фото и видео",
|
|
49
|
+
"Pin to Conversation": "",
|
|
50
50
|
"Pinned by": "",
|
|
51
|
-
"Please enable access to your photos and videos so you can share them.": "",
|
|
51
|
+
"Please enable access to your photos and videos so you can share them.": "Разрешите доступ к своим фотографиям и видео, чтобы вы могли ими поделиться.",
|
|
52
52
|
"Please select a channel first": "",
|
|
53
53
|
"Reconnecting...": "",
|
|
54
|
-
"Reply": "
|
|
55
|
-
"Reply to Message": "",
|
|
56
|
-
"Resend": "
|
|
57
|
-
"Search GIFs": "",
|
|
58
|
-
"Select More Photos": "",
|
|
59
|
-
"Send Anyway": "
|
|
60
|
-
"Send a message": "",
|
|
54
|
+
"Reply": "",
|
|
55
|
+
"Reply to Message": "Ответить на сообщение",
|
|
56
|
+
"Resend": "",
|
|
57
|
+
"Search GIFs": "Поиск GIF",
|
|
58
|
+
"Select More Photos": "Выбрать больше фотографий",
|
|
59
|
+
"Send Anyway": "",
|
|
60
|
+
"Send a message": "Отправить сообщение",
|
|
61
61
|
"Sending links is not allowed in this conversation": "",
|
|
62
|
-
"Slow mode ON": "",
|
|
63
|
-
"The message has been reported to a moderator.": "
|
|
64
|
-
"Thread Reply": "
|
|
65
|
-
"Unblock User": "
|
|
66
|
-
"Unknown User": "",
|
|
67
|
-
"Unmute User": "
|
|
68
|
-
"Unpin from Conversation": "
|
|
62
|
+
"Slow mode ON": "Медленный режим включен",
|
|
63
|
+
"The message has been reported to a moderator.": "",
|
|
64
|
+
"Thread Reply": "",
|
|
65
|
+
"Unblock User": "",
|
|
66
|
+
"Unknown User": "Неизвестный пользователь",
|
|
67
|
+
"Unmute User": "",
|
|
68
|
+
"Unpin from Conversation": "",
|
|
69
69
|
"Unread Messages": "",
|
|
70
|
-
"Video": "",
|
|
70
|
+
"Video": "видео",
|
|
71
71
|
"You": "",
|
|
72
72
|
"You can't send messages in this channel": "",
|
|
73
73
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
|
|
74
|
-
"{{ index }} of {{ photoLength }}": "",
|
|
75
|
-
"{{ replyCount }} Replies": "",
|
|
76
|
-
"{{ replyCount }} Thread Replies": "
|
|
74
|
+
"{{ index }} of {{ photoLength }}": "{{ index }} из {{ photoLength }}",
|
|
75
|
+
"{{ replyCount }} Replies": "{{ replyCount }} Ответов",
|
|
76
|
+
"{{ replyCount }} Thread Replies": "",
|
|
77
77
|
"{{ user }} is typing": "",
|
|
78
78
|
"🏙 Attachment...": ""
|
|
79
79
|
}
|
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
{
|
|
2
|
-
"1 Reply": "",
|
|
3
|
-
"1 Thread Reply": "
|
|
4
|
-
"Allow access to your Gallery": "",
|
|
5
|
-
"Allow camera access in device settings": "",
|
|
2
|
+
"1 Reply": "1 Cevap",
|
|
3
|
+
"1 Thread Reply": "",
|
|
4
|
+
"Allow access to your Gallery": "Galerinize erişime izin verin",
|
|
5
|
+
"Allow camera access in device settings": "Cihaz ayarlarında kamera erişimine izin ver",
|
|
6
6
|
"Also send to channel": "",
|
|
7
|
-
"Are you sure you want to permanently delete this message?": "
|
|
8
|
-
"Are you sure?": "
|
|
9
|
-
"Block User": "
|
|
10
|
-
"Cancel": "
|
|
11
|
-
"Cannot Flag Message": "
|
|
12
|
-
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "
|
|
13
|
-
"Copy Message": "
|
|
14
|
-
"Delete": "
|
|
15
|
-
"Delete Message": "
|
|
16
|
-
"Device camera is used to take photos or videos.": "",
|
|
17
|
-
"Do you want to send a copy of this message to a moderator for further investigation?": "
|
|
18
|
-
"Edit Message": "
|
|
19
|
-
"Editing Message": "",
|
|
20
|
-
"Emoji matching": "",
|
|
7
|
+
"Are you sure you want to permanently delete this message?": "",
|
|
8
|
+
"Are you sure?": "",
|
|
9
|
+
"Block User": "",
|
|
10
|
+
"Cancel": "",
|
|
11
|
+
"Cannot Flag Message": "",
|
|
12
|
+
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
|
|
13
|
+
"Copy Message": "",
|
|
14
|
+
"Delete": "",
|
|
15
|
+
"Delete Message": "",
|
|
16
|
+
"Device camera is used to take photos or videos.": "Cihaz kamerası fotoğraf veya video çekmek için kullanılır.",
|
|
17
|
+
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
18
|
+
"Edit Message": "",
|
|
19
|
+
"Editing Message": "Mesaj Düzenleniyor",
|
|
20
|
+
"Emoji matching": "Emoji eşleştirme",
|
|
21
21
|
"Empty message...": "",
|
|
22
22
|
"Error loading": "",
|
|
23
23
|
"Error loading channel list...": "",
|
|
24
24
|
"Error loading messages for this channel...": "",
|
|
25
25
|
"Error while loading, please reload/refresh": "",
|
|
26
|
-
"File type not supported": "",
|
|
27
|
-
"Flag": "
|
|
28
|
-
"Flag Message": "
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "
|
|
26
|
+
"File type not supported": "Dosya türü desteklenmiyor",
|
|
27
|
+
"Flag": "",
|
|
28
|
+
"Flag Message": "",
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
30
30
|
"How about sending your first message to a friend?": "",
|
|
31
|
-
"Instant Commands": "",
|
|
31
|
+
"Instant Commands": "Anlık Komutlar",
|
|
32
32
|
"Let's start chatting!": "",
|
|
33
33
|
"Links are disabled": "",
|
|
34
34
|
"Loading channels...": "",
|
|
35
35
|
"Loading messages...": "",
|
|
36
36
|
"Loading...": "",
|
|
37
37
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
38
|
-
"Message Reactions": "
|
|
38
|
+
"Message Reactions": "",
|
|
39
39
|
"Message deleted": "",
|
|
40
|
-
"Message flagged": "
|
|
41
|
-
"Mute User": "
|
|
40
|
+
"Message flagged": "",
|
|
41
|
+
"Mute User": "",
|
|
42
42
|
"Not supported": "",
|
|
43
43
|
"Nothing yet...": "",
|
|
44
|
-
"Ok": "
|
|
45
|
-
"Only visible to you": "
|
|
46
|
-
"Open Settings": "",
|
|
47
|
-
"Photo": "",
|
|
48
|
-
"Photos and Videos": "",
|
|
49
|
-
"Pin to Conversation": "
|
|
44
|
+
"Ok": "",
|
|
45
|
+
"Only visible to you": "",
|
|
46
|
+
"Open Settings": "Ayarları aç",
|
|
47
|
+
"Photo": "Fotoğraf",
|
|
48
|
+
"Photos and Videos": "Fotoğraflar ve Videolar",
|
|
49
|
+
"Pin to Conversation": "",
|
|
50
50
|
"Pinned by": "",
|
|
51
|
-
"Please enable access to your photos and videos so you can share them.": "",
|
|
51
|
+
"Please enable access to your photos and videos so you can share them.": "Paylaşım yapabilmek için lutfen fotoğraflarınıza ve videolarınıza erişimi etkinleştirin.",
|
|
52
52
|
"Please select a channel first": "",
|
|
53
53
|
"Reconnecting...": "",
|
|
54
|
-
"Reply": "
|
|
55
|
-
"Reply to Message": "",
|
|
56
|
-
"Resend": "
|
|
57
|
-
"Search GIFs": "",
|
|
58
|
-
"Select More Photos": "",
|
|
59
|
-
"Send Anyway": "
|
|
60
|
-
"Send a message": "",
|
|
54
|
+
"Reply": "",
|
|
55
|
+
"Reply to Message": "Mesajı Yanıtla",
|
|
56
|
+
"Resend": "",
|
|
57
|
+
"Search GIFs": "GIF Ara",
|
|
58
|
+
"Select More Photos": "Daha Fazla Fotoğraf Seçin",
|
|
59
|
+
"Send Anyway": "",
|
|
60
|
+
"Send a message": "Mesaj gönder",
|
|
61
61
|
"Sending links is not allowed in this conversation": "",
|
|
62
|
-
"Slow mode ON": "",
|
|
63
|
-
"The message has been reported to a moderator.": "
|
|
64
|
-
"Thread Reply": "
|
|
65
|
-
"Unblock User": "
|
|
66
|
-
"Unknown User": "",
|
|
67
|
-
"Unmute User": "
|
|
68
|
-
"Unpin from Conversation": "
|
|
62
|
+
"Slow mode ON": "Yavaş Mod Açık",
|
|
63
|
+
"The message has been reported to a moderator.": "",
|
|
64
|
+
"Thread Reply": "",
|
|
65
|
+
"Unblock User": "",
|
|
66
|
+
"Unknown User": "Bilinmeyen kullanıcı",
|
|
67
|
+
"Unmute User": "",
|
|
68
|
+
"Unpin from Conversation": "",
|
|
69
69
|
"Unread Messages": "",
|
|
70
|
-
"Video": "",
|
|
70
|
+
"Video": "Video",
|
|
71
71
|
"You": "",
|
|
72
72
|
"You can't send messages in this channel": "",
|
|
73
73
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
|
|
74
|
-
"{{ index }} of {{ photoLength }}": "",
|
|
75
|
-
"{{ replyCount }} Replies": "",
|
|
76
|
-
"{{ replyCount }} Thread Replies": "
|
|
74
|
+
"{{ index }} of {{ photoLength }}": "{{ index }} / {{ photoLength }}",
|
|
75
|
+
"{{ replyCount }} Replies": "{{ replyCount }} Cevap",
|
|
76
|
+
"{{ replyCount }} Thread Replies": "",
|
|
77
77
|
"{{ user }} is typing": "",
|
|
78
78
|
"🏙 Attachment...": ""
|
|
79
79
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "stream-chat-react-native-core",
|
|
3
3
|
"description": "The official React Native and Expo components for Stream Chat, a service for building chat applications",
|
|
4
|
-
"version": "5.26.0-beta.
|
|
4
|
+
"version": "5.26.0-beta.4",
|
|
5
5
|
"author": {
|
|
6
6
|
"company": "Stream.io Inc",
|
|
7
7
|
"name": "Stream.io Inc"
|
|
@@ -600,7 +600,7 @@ const ChannelWithContext = <
|
|
|
600
600
|
*/
|
|
601
601
|
const [hasNoMoreRecentMessagesToLoad, setHasNoMoreRecentMessagesToLoad] = useState(true);
|
|
602
602
|
|
|
603
|
-
const { setTargetedMessage, targetedMessage } = useTargetedMessage();
|
|
603
|
+
const { prevTargetedMessage, setTargetedMessage, targetedMessage } = useTargetedMessage();
|
|
604
604
|
|
|
605
605
|
/**
|
|
606
606
|
* If we loaded a channel around message
|
|
@@ -718,7 +718,7 @@ const ChannelWithContext = <
|
|
|
718
718
|
() => {
|
|
719
719
|
if (channel) {
|
|
720
720
|
clearInterval(mergeSetsIntervalRef.current);
|
|
721
|
-
setMessages(
|
|
721
|
+
setMessages(channel.state.messages);
|
|
722
722
|
restartSetsMergeFuncRef.current();
|
|
723
723
|
}
|
|
724
724
|
},
|
|
@@ -753,7 +753,7 @@ const ChannelWithContext = <
|
|
|
753
753
|
|
|
754
754
|
const copyChannelState = useRef(
|
|
755
755
|
throttle(
|
|
756
|
-
(
|
|
756
|
+
() => {
|
|
757
757
|
setLoading(false);
|
|
758
758
|
if (channel) {
|
|
759
759
|
setMembers({ ...channel.state.members });
|
|
@@ -762,7 +762,6 @@ const ChannelWithContext = <
|
|
|
762
762
|
setTyping({ ...channel.state.typing });
|
|
763
763
|
setWatcherCount(channel.state.watcher_count);
|
|
764
764
|
setWatchers({ ...channel.state.watchers });
|
|
765
|
-
onComplete?.();
|
|
766
765
|
}
|
|
767
766
|
},
|
|
768
767
|
stateUpdateThrottleInterval,
|
|
@@ -787,6 +786,8 @@ const ChannelWithContext = <
|
|
|
787
786
|
// subscribe to the generic all channel event
|
|
788
787
|
useEffect(() => {
|
|
789
788
|
const handleEvent: EventHandler<StreamChatGenerics> = (event) => {
|
|
789
|
+
const ignorableEvents = ['user.watching.start', 'user.watching.stop'];
|
|
790
|
+
if (ignorableEvents.includes(event.type)) return;
|
|
790
791
|
if (shouldSyncChannel) {
|
|
791
792
|
const isTypingEvent = event.type === 'typing.start' || event.type === 'typing.stop';
|
|
792
793
|
if (!isTypingEvent) {
|
|
@@ -805,6 +806,7 @@ const ChannelWithContext = <
|
|
|
805
806
|
// only update channel state if the events are not the previously subscribed useEffect's subscription events
|
|
806
807
|
if (
|
|
807
808
|
channel &&
|
|
809
|
+
channel.initialized &&
|
|
808
810
|
event.type !== 'message.new' &&
|
|
809
811
|
event.type !== 'message.read' &&
|
|
810
812
|
event.type !== 'typing.start' &&
|
|
@@ -861,8 +863,8 @@ const ChannelWithContext = <
|
|
|
861
863
|
const scrollToMessageIndex = scrollToMessageId
|
|
862
864
|
? currentMessages.findIndex(({ id }) => id === scrollToMessageId)
|
|
863
865
|
: -1;
|
|
864
|
-
|
|
865
866
|
if (channel && scrollToMessageIndex !== -1) {
|
|
867
|
+
copyChannelState.cancel();
|
|
866
868
|
// We assume that on average user sees 5 messages on screen
|
|
867
869
|
// We dont want new renders to happen while scrolling to the targeted message
|
|
868
870
|
// hence we limit the number of messages to be rendered after the targeted message to 5 - 1 = 4
|
|
@@ -870,21 +872,19 @@ const ChannelWithContext = <
|
|
|
870
872
|
// the previous latest message set will be thrown away as we cannot merge it with the current message set after the target message is set
|
|
871
873
|
const limitAfter = 4;
|
|
872
874
|
const currentLength = currentMessages.length;
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
hasOverlappingRecentMessagesRef.current = true;
|
|
887
|
-
}
|
|
875
|
+
const noOfMessagesAfter = currentLength - scrollToMessageIndex - 1;
|
|
876
|
+
// number of messages are over the limit, limit the length of messages
|
|
877
|
+
if (noOfMessagesAfter > limitAfter) {
|
|
878
|
+
const endIndex = scrollToMessageIndex + limitAfter;
|
|
879
|
+
channel.state.clearMessages();
|
|
880
|
+
channel.state.messages = currentMessages.slice(0, endIndex + 1);
|
|
881
|
+
splitLatestCurrentMessageSetRef.current();
|
|
882
|
+
const restOfMessages = currentMessages.slice(endIndex + 1);
|
|
883
|
+
if (hadCurrentLatestMessages) {
|
|
884
|
+
const latestSet = channel.state.messageSets.find((set) => set.isLatest);
|
|
885
|
+
if (latestSet) {
|
|
886
|
+
latestSet.messages = restOfMessages;
|
|
887
|
+
hasOverlappingRecentMessagesRef.current = true;
|
|
888
888
|
}
|
|
889
889
|
}
|
|
890
890
|
}
|
|
@@ -892,11 +892,12 @@ const ChannelWithContext = <
|
|
|
892
892
|
const hasLatestMessages = channel.state.latestMessages.length > 0;
|
|
893
893
|
channel.state.setIsUpToDate(hasLatestMessages);
|
|
894
894
|
setHasNoMoreRecentMessagesToLoad(hasLatestMessages);
|
|
895
|
-
copyChannelState(
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
}
|
|
895
|
+
copyChannelState();
|
|
896
|
+
if (scrollToMessageIndex !== -1) {
|
|
897
|
+
// since we need to scroll after immediately do this without throttle
|
|
898
|
+
copyChannelState.flush();
|
|
899
|
+
}
|
|
900
|
+
onAfterQueryCall?.();
|
|
900
901
|
} catch (err) {
|
|
901
902
|
if (err instanceof Error) {
|
|
902
903
|
setError(err);
|
|
@@ -956,7 +957,11 @@ const ChannelWithContext = <
|
|
|
956
957
|
await loadLatestMessagesRef.current();
|
|
957
958
|
}
|
|
958
959
|
},
|
|
959
|
-
|
|
960
|
+
() => {
|
|
961
|
+
if (unreadMessageIdToScrollTo) {
|
|
962
|
+
restartSetsMergeFuncRef.current();
|
|
963
|
+
}
|
|
964
|
+
},
|
|
960
965
|
() => unreadMessageIdToScrollTo,
|
|
961
966
|
);
|
|
962
967
|
};
|
|
@@ -997,12 +1002,21 @@ const ChannelWithContext = <
|
|
|
997
1002
|
},
|
|
998
1003
|
() => {
|
|
999
1004
|
if (messageIdToLoadAround) {
|
|
1005
|
+
clearInterval(mergeSetsIntervalRef.current); // do not merge sets as we will scroll/highlight to the message
|
|
1000
1006
|
setTargetedMessage(messageIdToLoadAround);
|
|
1001
1007
|
}
|
|
1002
1008
|
},
|
|
1003
1009
|
messageIdToLoadAround,
|
|
1004
1010
|
);
|
|
1005
1011
|
|
|
1012
|
+
useEffect(() => {
|
|
1013
|
+
if (!targetedMessage && prevTargetedMessage) {
|
|
1014
|
+
// we cleared the merge sets interval to wait for the targeted message to be set
|
|
1015
|
+
// now restart it since its done
|
|
1016
|
+
restartSetsMergeFuncRef.current();
|
|
1017
|
+
}
|
|
1018
|
+
}, [targetedMessage]);
|
|
1019
|
+
|
|
1006
1020
|
/**
|
|
1007
1021
|
* @deprecated use loadChannelAroundMessage instead
|
|
1008
1022
|
*
|
|
@@ -1091,7 +1105,7 @@ const ChannelWithContext = <
|
|
|
1091
1105
|
const currentLength = channel.state.messages.length || 0;
|
|
1092
1106
|
const didMerge = mergeOverlappingMessageSetsRef.current(true);
|
|
1093
1107
|
if (didMerge && channel.state.messages.length !== currentLength) {
|
|
1094
|
-
setMessages(
|
|
1108
|
+
setMessages(channel.state.messages);
|
|
1095
1109
|
}
|
|
1096
1110
|
}, 1000);
|
|
1097
1111
|
});
|
|
@@ -3,6 +3,11 @@ import { useEffect, useRef, useState } from 'react';
|
|
|
3
3
|
export const useTargetedMessage = (messageId?: string) => {
|
|
4
4
|
const clearTargetedMessageCall = useRef<ReturnType<typeof setTimeout>>();
|
|
5
5
|
const [targetedMessage, setTargetedMessage] = useState(messageId);
|
|
6
|
+
const prevTargetedMessageRef = useRef<string>();
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
prevTargetedMessageRef.current = targetedMessage;
|
|
10
|
+
}, [targetedMessage]);
|
|
6
11
|
|
|
7
12
|
useEffect(() => {
|
|
8
13
|
clearTargetedMessageCall.current = setTimeout(() => {
|
|
@@ -25,6 +30,7 @@ export const useTargetedMessage = (messageId?: string) => {
|
|
|
25
30
|
});
|
|
26
31
|
|
|
27
32
|
return {
|
|
33
|
+
prevTargetedMessage: prevTargetedMessageRef.current,
|
|
28
34
|
setTargetedMessage: setTargetedMessageTimeoutRef.current,
|
|
29
35
|
targetedMessage,
|
|
30
36
|
};
|
package/src/i18n/en.json
CHANGED
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"File type not supported": "File type not supported",
|
|
27
27
|
"Flag": "Flag",
|
|
28
28
|
"Flag Message": "Flag Message",
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "Flag action failed either due to a network issue or the message is already flagged
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "Flag action failed either due to a network issue or the message is already flagged",
|
|
30
30
|
"How about sending your first message to a friend?": "How about sending your first message to a friend?",
|
|
31
31
|
"Instant Commands": "Instant Commands",
|
|
32
32
|
"Let's start chatting!": "Let's start chatting!",
|
package/src/i18n/es.json
CHANGED
|
@@ -1,79 +1,79 @@
|
|
|
1
1
|
{
|
|
2
|
-
"1 Reply": "",
|
|
3
|
-
"1 Thread Reply": "
|
|
4
|
-
"Allow access to your Gallery": "",
|
|
5
|
-
"Allow camera access in device settings": "",
|
|
2
|
+
"1 Reply": "1 respuesta",
|
|
3
|
+
"1 Thread Reply": "",
|
|
4
|
+
"Allow access to your Gallery": "Permitir acceso a tu galería",
|
|
5
|
+
"Allow camera access in device settings": "Permitir el acceso a la cámara en la configuración del dispositivo",
|
|
6
6
|
"Also send to channel": "",
|
|
7
|
-
"Are you sure you want to permanently delete this message?": "
|
|
8
|
-
"Are you sure?": "
|
|
9
|
-
"Block User": "
|
|
10
|
-
"Cancel": "
|
|
11
|
-
"Cannot Flag Message": "
|
|
12
|
-
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "
|
|
13
|
-
"Copy Message": "
|
|
14
|
-
"Delete": "
|
|
15
|
-
"Delete Message": "
|
|
16
|
-
"Device camera is used to take photos or videos.": "",
|
|
17
|
-
"Do you want to send a copy of this message to a moderator for further investigation?": "
|
|
18
|
-
"Edit Message": "
|
|
19
|
-
"Editing Message": "",
|
|
20
|
-
"Emoji matching": "",
|
|
7
|
+
"Are you sure you want to permanently delete this message?": "",
|
|
8
|
+
"Are you sure?": "",
|
|
9
|
+
"Block User": "",
|
|
10
|
+
"Cancel": "",
|
|
11
|
+
"Cannot Flag Message": "",
|
|
12
|
+
"Consider how your comment might make others feel and be sure to follow our Community Guidelines": "",
|
|
13
|
+
"Copy Message": "",
|
|
14
|
+
"Delete": "",
|
|
15
|
+
"Delete Message": "",
|
|
16
|
+
"Device camera is used to take photos or videos.": "La cámara del dispositivo se utiliza para tomar fotografías o vídeos.",
|
|
17
|
+
"Do you want to send a copy of this message to a moderator for further investigation?": "",
|
|
18
|
+
"Edit Message": "",
|
|
19
|
+
"Editing Message": "Editando mensaje",
|
|
20
|
+
"Emoji matching": "Coincidencia de emoji",
|
|
21
21
|
"Empty message...": "",
|
|
22
22
|
"Error loading": "",
|
|
23
23
|
"Error loading channel list...": "",
|
|
24
24
|
"Error loading messages for this channel...": "",
|
|
25
25
|
"Error while loading, please reload/refresh": "",
|
|
26
|
-
"File type not supported": "",
|
|
27
|
-
"Flag": "
|
|
28
|
-
"Flag Message": "
|
|
29
|
-
"Flag action failed either due to a network issue or the message is already flagged": "
|
|
26
|
+
"File type not supported": "Tipo de archivo no admitido",
|
|
27
|
+
"Flag": "",
|
|
28
|
+
"Flag Message": "",
|
|
29
|
+
"Flag action failed either due to a network issue or the message is already flagged": "",
|
|
30
30
|
"How about sending your first message to a friend?": "",
|
|
31
|
-
"Instant Commands": "",
|
|
31
|
+
"Instant Commands": "Comandos instantáneos",
|
|
32
32
|
"Let's start chatting!": "",
|
|
33
33
|
"Links are disabled": "",
|
|
34
34
|
"Loading channels...": "",
|
|
35
35
|
"Loading messages...": "",
|
|
36
36
|
"Loading...": "",
|
|
37
37
|
"Maximum file size upload limit reached. Please upload a file below {{MAX_FILE_SIZE_TO_UPLOAD_IN_MB}} MB.": "",
|
|
38
|
-
"Message Reactions": "
|
|
38
|
+
"Message Reactions": "",
|
|
39
39
|
"Message deleted": "",
|
|
40
|
-
"Message flagged": "
|
|
41
|
-
"Mute User": "
|
|
40
|
+
"Message flagged": "",
|
|
41
|
+
"Mute User": "",
|
|
42
42
|
"Not supported": "",
|
|
43
43
|
"Nothing yet...": "",
|
|
44
|
-
"Ok": "
|
|
45
|
-
"Only visible to you": "
|
|
46
|
-
"Open Settings": "",
|
|
47
|
-
"Photo": "",
|
|
48
|
-
"Photos and Videos": "",
|
|
49
|
-
"Pin to Conversation": "
|
|
44
|
+
"Ok": "",
|
|
45
|
+
"Only visible to you": "",
|
|
46
|
+
"Open Settings": "Configuración abierta",
|
|
47
|
+
"Photo": "Foto",
|
|
48
|
+
"Photos and Videos": "Fotos y videos",
|
|
49
|
+
"Pin to Conversation": "",
|
|
50
50
|
"Pinned by": "",
|
|
51
|
-
"Please enable access to your photos and videos so you can share them.": "",
|
|
51
|
+
"Please enable access to your photos and videos so you can share them.": "Por favor, habilita el acceso a tus fotos y videos para poder compartirlos.",
|
|
52
52
|
"Please select a channel first": "",
|
|
53
53
|
"Reconnecting...": "",
|
|
54
|
-
"Reply": "
|
|
55
|
-
"Reply to Message": "",
|
|
56
|
-
"Resend": "
|
|
57
|
-
"Search GIFs": "",
|
|
58
|
-
"Select More Photos": "",
|
|
59
|
-
"Send Anyway": "
|
|
60
|
-
"Send a message": "",
|
|
54
|
+
"Reply": "",
|
|
55
|
+
"Reply to Message": "Responder al mensaje",
|
|
56
|
+
"Resend": "",
|
|
57
|
+
"Search GIFs": "Buscar GIFs",
|
|
58
|
+
"Select More Photos": "Seleccionar más fotos",
|
|
59
|
+
"Send Anyway": "",
|
|
60
|
+
"Send a message": "Enviar un mensaje",
|
|
61
61
|
"Sending links is not allowed in this conversation": "",
|
|
62
|
-
"Slow mode ON": "",
|
|
63
|
-
"The message has been reported to a moderator.": "
|
|
64
|
-
"Thread Reply": "
|
|
65
|
-
"Unblock User": "
|
|
66
|
-
"Unknown User": "",
|
|
67
|
-
"Unmute User": "
|
|
68
|
-
"Unpin from Conversation": "
|
|
62
|
+
"Slow mode ON": "Modo lento ACTIVADO",
|
|
63
|
+
"The message has been reported to a moderator.": "",
|
|
64
|
+
"Thread Reply": "",
|
|
65
|
+
"Unblock User": "",
|
|
66
|
+
"Unknown User": "Usuario desconocido",
|
|
67
|
+
"Unmute User": "",
|
|
68
|
+
"Unpin from Conversation": "",
|
|
69
69
|
"Unread Messages": "",
|
|
70
|
-
"Video": "",
|
|
70
|
+
"Video": "Video",
|
|
71
71
|
"You": "",
|
|
72
72
|
"You can't send messages in this channel": "",
|
|
73
73
|
"{{ firstUser }} and {{ nonSelfUserLength }} more are typing": "",
|
|
74
|
-
"{{ index }} of {{ photoLength }}": "",
|
|
75
|
-
"{{ replyCount }} Replies": "",
|
|
76
|
-
"{{ replyCount }} Thread Replies": "
|
|
74
|
+
"{{ index }} of {{ photoLength }}": "{{ index }} de {{ photoLength }}",
|
|
75
|
+
"{{ replyCount }} Replies": "{{ replyCount }} Respuestas",
|
|
76
|
+
"{{ replyCount }} Thread Replies": "",
|
|
77
77
|
"{{ user }} is typing": "",
|
|
78
78
|
"🏙 Attachment...": ""
|
|
79
79
|
}
|