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.
Files changed (63) hide show
  1. package/lib/commonjs/components/Channel/Channel.js +56 -45
  2. package/lib/commonjs/components/Channel/Channel.js.map +1 -1
  3. package/lib/commonjs/components/Channel/hooks/useTargetedMessage.js +5 -0
  4. package/lib/commonjs/components/Channel/hooks/useTargetedMessage.js.map +1 -1
  5. package/lib/commonjs/i18n/en.json +1 -1
  6. package/lib/commonjs/i18n/es.json +51 -51
  7. package/lib/commonjs/i18n/fr.json +51 -51
  8. package/lib/commonjs/i18n/he.json +51 -51
  9. package/lib/commonjs/i18n/hi.json +51 -51
  10. package/lib/commonjs/i18n/it.json +51 -51
  11. package/lib/commonjs/i18n/ja.json +51 -51
  12. package/lib/commonjs/i18n/ko.json +51 -51
  13. package/lib/commonjs/i18n/nl.json +51 -51
  14. package/lib/commonjs/i18n/pt-BR.json +51 -51
  15. package/lib/commonjs/i18n/ru.json +51 -51
  16. package/lib/commonjs/i18n/tr.json +51 -51
  17. package/lib/commonjs/version.json +1 -1
  18. package/lib/module/components/Channel/Channel.js +56 -45
  19. package/lib/module/components/Channel/Channel.js.map +1 -1
  20. package/lib/module/components/Channel/hooks/useTargetedMessage.js +5 -0
  21. package/lib/module/components/Channel/hooks/useTargetedMessage.js.map +1 -1
  22. package/lib/module/i18n/en.json +1 -1
  23. package/lib/module/i18n/es.json +51 -51
  24. package/lib/module/i18n/fr.json +51 -51
  25. package/lib/module/i18n/he.json +51 -51
  26. package/lib/module/i18n/hi.json +51 -51
  27. package/lib/module/i18n/it.json +51 -51
  28. package/lib/module/i18n/ja.json +51 -51
  29. package/lib/module/i18n/ko.json +51 -51
  30. package/lib/module/i18n/nl.json +51 -51
  31. package/lib/module/i18n/pt-BR.json +51 -51
  32. package/lib/module/i18n/ru.json +51 -51
  33. package/lib/module/i18n/tr.json +51 -51
  34. package/lib/module/version.json +1 -1
  35. package/lib/typescript/components/Channel/hooks/useTargetedMessage.d.ts +1 -0
  36. package/lib/typescript/i18n/en.json +1 -1
  37. package/lib/typescript/i18n/es.json +51 -51
  38. package/lib/typescript/i18n/fr.json +51 -51
  39. package/lib/typescript/i18n/he.json +51 -51
  40. package/lib/typescript/i18n/hi.json +51 -51
  41. package/lib/typescript/i18n/it.json +51 -51
  42. package/lib/typescript/i18n/ja.json +51 -51
  43. package/lib/typescript/i18n/ko.json +51 -51
  44. package/lib/typescript/i18n/nl.json +51 -51
  45. package/lib/typescript/i18n/pt-BR.json +51 -51
  46. package/lib/typescript/i18n/ru.json +51 -51
  47. package/lib/typescript/i18n/tr.json +51 -51
  48. package/package.json +1 -1
  49. package/src/components/Channel/Channel.tsx +41 -27
  50. package/src/components/Channel/hooks/useTargetedMessage.ts +6 -0
  51. package/src/i18n/en.json +1 -1
  52. package/src/i18n/es.json +51 -51
  53. package/src/i18n/fr.json +51 -51
  54. package/src/i18n/he.json +51 -51
  55. package/src/i18n/hi.json +51 -51
  56. package/src/i18n/it.json +51 -51
  57. package/src/i18n/ja.json +51 -51
  58. package/src/i18n/ko.json +51 -51
  59. package/src/i18n/nl.json +51 -51
  60. package/src/i18n/pt-BR.json +51 -51
  61. package/src/i18n/ru.json +51 -51
  62. package/src/i18n/tr.json +51 -51
  63. package/src/version.json +1 -1
@@ -1,79 +1,79 @@
1
1
  {
2
- "1 Reply": "",
3
- "1 Thread Reply": "1 тема Ответить",
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": "{{replyCount}} Ответы в темах",
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": "1 Konu Yanıtı",
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?": "Bu mesajı kalıcı olarak silmek istediğinizden emin misiniz?",
8
- "Are you sure?": "Emin misiniz?",
9
- "Block User": "Kullanıcıyı engelle",
10
- "Cancel": "İptal",
11
- "Cannot Flag Message": "Raporlama Başarısız",
12
- "Consider how your comment might make others feel and be sure to follow our Community Guidelines": "Yorumunuzun diğerlerini nasıl hissettirebileceğini düşünün ve topluluk kurallarımızı takip ettiğinizden emin olun",
13
- "Copy Message": "Mesajı Kopyala",
14
- "Delete": "Sil",
15
- "Delete Message": "Mesajı Sil",
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?": "Detaylı inceleme için bu mesajın kopyasını moderatöre göndermek istiyor musunuz?",
18
- "Edit Message": "Mesajı Düzenle",
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": "Raporla",
28
- "Flag Message": "Mesajı Raporla",
29
- "Flag action failed either due to a network issue or the message is already flagged": "Mesajın daha önce raporlanmış olması veya bir ağ bağlantısı sorunu nedeniyle raporlama işlemi başarısız oldu.",
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": "Mesaj Tepkileri",
38
+ "Message Reactions": "",
39
39
  "Message deleted": "",
40
- "Message flagged": "Mesaj işaretlendi",
41
- "Mute User": "Kullanıcıyı sessize al",
40
+ "Message flagged": "",
41
+ "Mute User": "",
42
42
  "Not supported": "",
43
43
  "Nothing yet...": "",
44
- "Ok": "Tamam",
45
- "Only visible to you": "Sadece siz görebilirsiniz",
46
- "Open Settings": "",
47
- "Photo": "",
48
- "Photos and Videos": "",
49
- "Pin to Conversation": "Konuşmaya sabitle",
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": "Yanıtla",
55
- "Reply to Message": "",
56
- "Resend": "Yeniden gönder",
57
- "Search GIFs": "",
58
- "Select More Photos": "",
59
- "Send Anyway": "Yine de Gönder",
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.": "Mesaj moderatöre bildirildi.",
64
- "Thread Reply": "Konu Yanıtı",
65
- "Unblock User": "Kullanıcının engelini kaldır",
66
- "Unknown User": "",
67
- "Unmute User": "Kullanıcının sesini aç",
68
- "Unpin from Conversation": "Sabitlemeyi kaldır",
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": "{{responseCount}} Konu Cevapı",
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.3",
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([...channel.state.messages]);
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
- (onComplete: (() => void) | undefined = undefined) => {
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
- if (scrollToMessageIndex !== -1) {
874
- const noOfMessagesAfter = currentLength - scrollToMessageIndex - 1;
875
- // number of messages are over the limit, limit the length of messages
876
- if (noOfMessagesAfter > limitAfter) {
877
- const endIndex = scrollToMessageIndex + limitAfter;
878
- channel.state.clearMessages();
879
- channel.state.messages = currentMessages.slice(0, endIndex + 1);
880
- splitLatestCurrentMessageSetRef.current();
881
- const restOfMessages = currentMessages.slice(endIndex + 1);
882
- if (hadCurrentLatestMessages) {
883
- const latestSet = channel.state.messageSets.find((set) => set.isLatest);
884
- if (latestSet) {
885
- latestSet.messages = restOfMessages;
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
- // only after the debounce interval completes, we will merge the sets and set any other states
897
- restartSetsMergeFuncRef.current();
898
- onAfterQueryCall?.();
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
- undefined,
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([...channel.state.messages]);
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": "1 respuesta de hilo",
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?": "¿Estás seguro de que deseas eliminar permanentemente este mensaje?",
8
- "Are you sure?": "¿Estás seguro?",
9
- "Block User": "Bloquear usuario",
10
- "Cancel": "Cancelar",
11
- "Cannot Flag Message": "No se puede reportar el mensaje",
12
- "Consider how your comment might make others feel and be sure to follow our Community Guidelines": "Considera cómo tu comentario podría hacer sentir a los demás y asegúrate de seguir nuestras Normas de la Comunidad",
13
- "Copy Message": "Copiar mensaje",
14
- "Delete": "Eliminar",
15
- "Delete Message": "Eliminar mensaje",
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?": "¿Deseas enviar una copia de este mensaje a un moderador para una investigación adicional?",
18
- "Edit Message": "Editar mensaje",
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": "Reportar",
28
- "Flag Message": "Reportar mensaje",
29
- "Flag action failed either due to a network issue or the message is already flagged": "El reporte falló debido a un problema de red o el mensaje ya fue reportado.",
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": "Reacciones al mensaje",
38
+ "Message Reactions": "",
39
39
  "Message deleted": "",
40
- "Message flagged": "Mensaje reportado",
41
- "Mute User": "Silenciar usuario",
40
+ "Message flagged": "",
41
+ "Mute User": "",
42
42
  "Not supported": "",
43
43
  "Nothing yet...": "",
44
- "Ok": "Aceptar",
45
- "Only visible to you": "Solo visible para ti",
46
- "Open Settings": "",
47
- "Photo": "",
48
- "Photos and Videos": "",
49
- "Pin to Conversation": "Fijar a la conversación",
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": "Responder",
55
- "Reply to Message": "",
56
- "Resend": "Reenviar",
57
- "Search GIFs": "",
58
- "Select More Photos": "",
59
- "Send Anyway": "Enviar de todos modos",
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.": "El mensaje ha sido reportado a un moderador.",
64
- "Thread Reply": "Respuesta de hilo",
65
- "Unblock User": "Desbloquear usuario",
66
- "Unknown User": "",
67
- "Unmute User": "Activar sonido del usuario",
68
- "Unpin from Conversation": "Desmarcar de la conversación",
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": "{{ replyCount }} respuestas de hilo",
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
  }