Skip to content

Commit a786431

Browse files
authored
Merge pull request #931 from GetStream/scroll-manager-fix
Fix empty channel crash
2 parents 3361a34 + 8093253 commit a786431

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

CHANGELOG.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
# Changelog
22

3+
## [6.0.1](https://github.com/GetStream/stream-chat-react/releases/tag/v6.0.1) 2021-05-19
4+
5+
### Feature
6+
7+
- Expose the `MessageContext` to the `VirtualizedMessageList`'s `Message` UI component [#924](https://github.com/GetStream/stream-chat-react/pull/924)
8+
9+
### Chore
10+
11+
- Reorganize component documentation for v6 [#926](https://github.com/GetStream/stream-chat-react/pull/926)
12+
13+
### Bug
14+
15+
- Prevent crash when navigate away from, and then back to, an empty channel [#931](https://github.com/GetStream/stream-chat-react/pull/931)
16+
317
## [6.0.0](https://github.com/GetStream/stream-chat-react/releases/tag/v6.0.0) 2021-05-17
418

519
### ⚠️ BREAKING CHANGES ⚠️ - Please review our v6 [implementation guide](https://github.com/GetStream/stream-chat-react/wiki) prior to upgrading.

src/components/MessageList/hooks/useMessageListScrollManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ export function useMessageListScrollManager<
7070
const prevMeasures = measures.current;
7171
const prevMessages = messages.current;
7272
const newMessages = params.messages;
73-
const lastNewMessage = newMessages[newMessages.length - 1];
73+
const lastNewMessage = newMessages[newMessages.length - 1] || {};
7474
const lastPrevMessage = prevMessages?.[prevMessages.length - 1];
7575
const newMeasures = scrollContainerMeasures();
7676

0 commit comments

Comments
 (0)