Skip to content

Commit b37e35b

Browse files
author
Sravan S
authored
fix: onlinestatus should work even configureSession is provided (#366)
This feature was disabled because of a bug in sessionHandler in SDK now, we can re-enable this see: #307 fixes: https://sendbird.atlassian.net/browse/SBISSUE-10323
1 parent 74aa4a9 commit b37e35b

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib/Sendbird.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ export default function Sendbird(props) {
141141
};
142142
}, [currenttheme]);
143143

144-
const isOnline = useOnlineStatus(sdkStore.sdk, logger, configureSession);
144+
const isOnline = useOnlineStatus(sdkStore.sdk, logger);
145145

146146
const localeStringSet = React.useMemo(() => {
147147
if (!stringSet) {

src/lib/hooks/useOnlineStatus.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useState, useEffect } from 'react';
33

44
import { uuidv4 } from '../../utils/uuid';
55

6-
function useConnectionStatus(sdk, logger, configureSession) {
6+
function useConnectionStatus(sdk, logger) {
77
const [isOnline, setIsOnline] = useState(true);
88

99
useEffect(() => {
@@ -29,7 +29,7 @@ function useConnectionStatus(sdk, logger, configureSession) {
2929
logger.info('Added ConnectionHandler', uniqueHandlerId);
3030
// workaround -> addConnectionHandler invalidates session handler
3131
// provided through configureSession
32-
if (sdk?.addConnectionHandler && !configureSession) {
32+
if (sdk?.addConnectionHandler) {
3333
sdk.addConnectionHandler(uniqueHandlerId, handler);
3434
}
3535
} catch {
@@ -43,7 +43,7 @@ function useConnectionStatus(sdk, logger, configureSession) {
4343
//
4444
}
4545
};
46-
}, [sdk, configureSession]);
46+
}, [sdk]);
4747

4848
useEffect(() => {
4949
const tryReconnect = () => {

0 commit comments

Comments
 (0)