Skip to content
This repository was archived by the owner on Nov 5, 2024. It is now read-only.

Commit bc60214

Browse files
committed
fix: use custom RTM UID for user data when available
1 parent b30da1e commit bc60214

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/RTMConfigure.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ const RtmConfigure = (props: any) => {
104104

105105
const init = async () => {
106106
setRtmStatus(rtmStatusEnum.initialising)
107+
// rtmProps?.uid
108+
// ? (localUid.current = String(rtmProps.uid))
109+
// :
107110
rtcProps.uid
108111
? (localUid.current = String(rtcProps.uid))
109112
: (localUid.current = String(timeNow()))
@@ -192,7 +195,7 @@ const RtmConfigure = (props: any) => {
192195
const createUserData = () => {
193196
return {
194197
messageType: 'UserData',
195-
rtmId: localUid.current,
198+
rtmId: rtmProps?.uid || localUid.current,
196199
rtcId: rtcUid.current,
197200
username: rtmProps?.username,
198201
role: rtcProps.role === 'audience' ? 1 : 0,

0 commit comments

Comments
 (0)