Skip to content

Commit d0020c2

Browse files
authored
[SBISSUE-18879] scrollToBottom doesn't work when send a message in mobile. (#1329)
### Ticket [SBISSUE-18879](https://sendbird.atlassian.net/browse/SBISSUE-18879) ### Changelog * Fixed a bug where `scrollToBottom` doesn't work when send a message in mobile environment. [SBISSUE-18879]: https://sendbird.atlassian.net/browse/SBISSUE-18879?atlOrigin=eyJpIjoiNWRkNTljNzYxNjVmNDY3MDlhMDU5Y2ZhYzA5YTRkZjUiLCJwIjoiZ2l0aHViLWNvbS1KU1cifQ
1 parent 2bd06e7 commit d0020c2

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

src/modules/GroupChannel/context/hooks/useGroupChannel.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ import useSendbird from '../../../../lib/Sendbird/context/hooks/useSendbird';
1919
import { GroupChannelContext } from '../GroupChannelProvider';
2020
import type { GroupChannelState, MessageActions } from '../types';
2121
import { useMessageActions } from './useMessageActions';
22-
import { delay } from '../../../../utils/utils';
2322

2423
export interface GroupChannelActions extends MessageActions {
2524
// Channel actions
@@ -71,8 +70,6 @@ export const useGroupChannel = () => {
7170
setAnimatedMessageId(null);
7271
setIsScrollBottomReached(true);
7372

74-
// wait a bit for scroll ref to be updated
75-
await delay();
7673
if (config.isOnline && state.hasNext()) {
7774
await state.resetWithStartingPoint(Number.MAX_SAFE_INTEGER);
7875
}

src/modules/GroupChannel/context/hooks/useMessageActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export function useMessageActions(params: Params): MessageActions {
102102
() => {
103103
setTimeout(scrollToBottom, 0);
104104
},
105-
[],
105+
[scrollToBottom],
106106
);
107107

108108
const processParams = useCallback(async <T extends keyof MessageParamsByType>(

0 commit comments

Comments
 (0)