Skip to content

Commit 7f93a07

Browse files
authored
release: v3.16.3 (#1325)
1 parent 80e7d1f commit 7f93a07

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

CHANGELOG.md

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

3+
## [v3.16.3] (Apr 3 2025)
4+
### Fixes:
5+
- Fixed an issue where the connection is still alive after `SendbirdProvider` have been unmounted.
6+
- Fixed an undefined error of `emojiCategory`.
7+
38
## [v3.16.2] (Mar 28 2025)
49
### Features:
510
- Added `tel` and `mailto` protocol support for the markup link

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@sendbird/uikit-react",
3-
"version": "3.16.2",
3+
"version": "3.16.3",
44
"description": "Sendbird UIKit for React: A feature-rich and customizable chat UI kit with messaging, channel management, and user authentication.",
55
"keywords": [
66
"sendbird",

src/modules/GroupChannel/context/__tests__/useMessageListScroll.spec.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,17 @@ describe('useMessageListScroll', () => {
146146
});
147147

148148
describe('scroll', () => {
149-
it('should do nothing if scrollRef is null', async () => {
149+
it('should call resolve() even if scrollRef is null', async () => {
150150
const { result } = renderHook(() => useMessageListScroll('auto'));
151151
const resolveMock = jest.fn();
152152

153153
await act(async () => {
154154
result.current.scrollPubSub.publish('scroll', { resolve: resolveMock });
155155
});
156156

157-
expect(resolveMock).not.toHaveBeenCalled();
157+
await waitFor(() => {
158+
expect(resolveMock).toHaveBeenCalled();
159+
});
158160
});
159161

160162
it('should use scrollTop if scroll method is not defined', async () => {

src/modules/GroupChannel/context/hooks/useMessageListScroll.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,20 +72,23 @@ export function useMessageListScroll(behavior: 'smooth' | 'auto', deps: Dependen
7272
unsubscribes.push(
7373
scrollPubSub.subscribe('scroll', ({ top, animated, lazy, resolve }) => {
7474
runCallback(() => {
75-
if (!scrollRef.current) return;
75+
if (!scrollRef.current || typeof top !== 'number') {
76+
resolve?.();
77+
return;
78+
}
7679
const { scrollTop, scrollHeight, clientHeight } = scrollRef.current;
7780

7881
if (scrollRef.current.scroll) {
7982
scrollRef.current.scroll({ top, behavior: getScrollBehavior(behavior, animated) });
80-
} else if (typeof top === 'number') {
83+
} else {
8184
scrollRef.current.scrollTop = top;
8285
}
8386

8487
// Update data by manual update
8588
scrollDistanceFromBottomRef.current = Math.max(0, scrollHeight - scrollTop - clientHeight);
8689
setIsScrollBottomReached(scrollDistanceFromBottomRef.current === 0);
8790

88-
if (resolve) resolve();
91+
resolve?.();
8992
}, lazy);
9093
}),
9194
);

0 commit comments

Comments
 (0)