stream-chat-react-native-core 8.13.6 → 8.13.8

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.
@@ -1102,7 +1102,7 @@ const ChannelWithContext = (props: PropsWithChildren<ChannelPropsWithContext>) =
1102
1102
  const parentID = thread.id;
1103
1103
 
1104
1104
  const limit = 50;
1105
- channel.state.threads[parentID] = [];
1105
+ // channel.state.threads[parentID] = [];
1106
1106
  const queryResponse = await channel.getReplies(parentID, {
1107
1107
  limit,
1108
1108
  });
@@ -25,7 +25,7 @@ export const useChannelPreviewData = (
25
25
  ) => {
26
26
  const [forceUpdate, setForceUpdate] = useState(0);
27
27
  const [lastMessage, setLastMessageInner] = useState<LastMessageType>(
28
- () => channel.state.messages[channel.state.messages.length - 1],
28
+ () => channel.state.latestMessages[channel.state.latestMessages.length - 1],
29
29
  );
30
30
  const throttledSetLastMessage = useMemo(
31
31
  () =>
@@ -44,7 +44,7 @@ export const useChannelPreviewData = (
44
44
  const { forceUpdate: contextForceUpdate } = useChannelsContext();
45
45
  const channelListForceUpdate = forceUpdateOverride ?? contextForceUpdate;
46
46
 
47
- const channelLastMessage = channel.lastMessage();
47
+ const channelLastMessage = channel.state.latestMessages[channel.state.latestMessages.length - 1];
48
48
  const channelLastMessageString = `${channelLastMessage?.id}${channelLastMessage?.updated_at}`;
49
49
 
50
50
  const refreshUnreadCount = useMemo(
@@ -191,6 +191,7 @@ const ChatWithContext = (props: PropsWithChildren<ChatProps>) => {
191
191
  client.deviceIdentifier = { os: `${Platform.OS} ${Platform.Version}` };
192
192
  // This is to disable recovery related logic in js client, since we handle it in this SDK
193
193
  client.recoverStateOnReconnect = false;
194
+ client.preventThreadCleanup = true;
194
195
  client.persistUserOnConnectionFailure = enableOfflineSupport;
195
196
  }
196
197
 
package/src/version.json CHANGED
@@ -1,3 +1,3 @@
1
1
  {
2
- "version": "8.13.6"
2
+ "version": "8.13.8"
3
3
  }