Skip to content

Commit ed95614

Browse files
authored
Merge pull request #2 from talkjs/chore/add_signature_to_session
(talkjs/react) added signature to session
2 parents 61d216c + 76e2037 commit ed95614

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/Session.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,14 @@ type SessionProps = UserProps &
1515
sessionRef?: React.MutableRefObject<Talk.Session | undefined>;
1616
desktopNotificationEnabled?: boolean;
1717
children?: ReactNode;
18+
signature?: string;
1819
};
1920

2021
export function Session(props: SessionProps) {
2122
const [ready, markReady] = useState(false);
2223
const [session, setSession] = useState<Talk.Session>();
2324

24-
const { userId, syncUser, appId, sessionRef, desktopNotificationEnabled } =
25+
const { userId, syncUser, appId, signature, sessionRef, desktopNotificationEnabled } =
2526
props;
2627

2728
useEffect(() => {
@@ -35,7 +36,7 @@ export function Session(props: SessionProps) {
3536
? syncUser()
3637
: syncUser ?? new Talk.User(userId);
3738

38-
const session = new Talk.Session({ appId, me });
39+
const session = new Talk.Session({ appId, me, signature });
3940
setSession(session);
4041
if (sessionRef) {
4142
sessionRef.current = session;

0 commit comments

Comments
 (0)