Skip to content

Commit ac74f70

Browse files
author
Sravan S
authored
hotfix: disableMarkAsRead should be passed (#573)
disableMarkAsRead should be passed down as a param in useHandleChannelEvents
1 parent 66609aa commit ac74f70

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/modules/Channel/context/ChannelProvider.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -319,6 +319,7 @@ const ChannelProvider: React.FC<ChannelContextProps> = (props: ChannelContextPro
319319
currentGroupChannel,
320320
sdkInit,
321321
currentUserId: userId,
322+
disableMarkAsRead,
322323
},
323324
{
324325
messagesDispatcher,

src/modules/Channel/context/hooks/useHandleChannelEvents.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import uuidv4 from '../../../../utils/uuid';
99
import compareIds from '../../../../utils/compareIds';
1010
import * as messageActions from '../dux/actionTypes';
1111
import useSendbirdStateContext from '../../../../hooks/useSendbirdStateContext';
12-
import { useChannelContext } from '../ChannelProvider';
1312

1413
/**
1514
* Handles ChannelEvents and send values to dispatcher using messagesDispatcher
@@ -23,6 +22,7 @@ interface DynamicParams {
2322
sdkInit: boolean;
2423
currentUserId: string;
2524
currentGroupChannel: GroupChannel;
25+
disableMarkAsRead: boolean;
2626
}
2727
interface StaticParams {
2828
sdk: SendbirdGroupChat;
@@ -38,16 +38,15 @@ function useHandleChannelEvents({
3838
sdkInit,
3939
currentUserId,
4040
currentGroupChannel,
41+
disableMarkAsRead,
4142
}: DynamicParams, {
4243
sdk,
4344
logger,
4445
scrollRef,
4546
setQuoteMessage,
4647
messagesDispatcher,
4748
}: StaticParams): void {
48-
const channelStore = useChannelContext();
4949
const store = useSendbirdStateContext();
50-
const { disableMarkAsRead = {} } = channelStore ?? {};
5150
const {
5251
markAsReadScheduler,
5352
markAsDeliveredScheduler,

0 commit comments

Comments
 (0)