Skip to content

Commit 218e687

Browse files
authored
fix: sessionHandler should be added with configureSession #293
Before: setSessionHandler was called when `accessToken` was null See: https://gist.github.com/sravan-s/4bfd6379c8561112a0fcd0bc3f1b7d15
1 parent a2ab7c8 commit 218e687

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/lib/dux/sdk/thunks.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ export const handleConnection = ({
7878
const newSdk = SendbirdChat.init(params);
7979
if (configureSession && typeof configureSession === 'function') {
8080
sessionHandler = configureSession(newSdk);
81+
newSdk.setSessionHandler(sessionHandler);
8182
}
8283
// to check if code is released version from rollup and *not from storybook*
8384
// see rollup config file
@@ -113,9 +114,6 @@ export const handleConnection = ({
113114
.then((res) => connectCbSucess(res))
114115
.catch((err) => connectCbError(err));
115116
} else {
116-
if (sessionHandler) {
117-
newSdk.setSessionHandler(sessionHandler);
118-
}
119117
newSdk.connect(userId)
120118
.then((res) => connectCbSucess(res))
121119
.catch((err) => connectCbError(err));

0 commit comments

Comments
 (0)