agora-appbuilder-core 2.3.0-beta.2 → 2.3.0-beta.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agora-appbuilder-core",
3
- "version": "2.3.0-beta.2",
3
+ "version": "2.3.0-beta.3",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -91,7 +91,7 @@ export const LiveStreamContextProvider: React.FC<liveStreamPropsInterface> = (
91
91
  payload: Partial<raiseHandItemInterface>,
92
92
  ) => {
93
93
  if (userUID && !isEmptyObject(payload)) {
94
- const userId = userUID.toString();
94
+ const userId = `${userUID}`;
95
95
  setRaiseHandList((oldRaisedHandList) => ({
96
96
  ...oldRaisedHandList,
97
97
  [userId]: {
@@ -342,7 +342,7 @@ export const LiveStreamContextProvider: React.FC<liveStreamPropsInterface> = (
342
342
  */
343
343
 
344
344
  const hostApprovesRequestOfUID = (uid: UidType) => {
345
- addOrUpdateLiveStreamRequest(uid.toString(), {
345
+ addOrUpdateLiveStreamRequest(`${uid}`, {
346
346
  raised: RaiseHandValue.TRUE,
347
347
  ts: new Date().getTime(),
348
348
  });
@@ -354,7 +354,7 @@ export const LiveStreamContextProvider: React.FC<liveStreamPropsInterface> = (
354
354
  };
355
355
 
356
356
  const hostRejectsRequestOfUID = (uid: UidType) => {
357
- addOrUpdateLiveStreamRequest(uid.toString(), {
357
+ addOrUpdateLiveStreamRequest(`${uid}`, {
358
358
  raised: RaiseHandValue.FALSE,
359
359
  ts: new Date().getTime(),
360
360
  });
@@ -84,7 +84,9 @@ class CustomEvents {
84
84
  * @param {ToOptions} to uid or uids[] of user
85
85
  * @api private
86
86
  */
87
- private _send = async (rtmPayload: any, to?: ToOptions) => {
87
+ private _send = async (rtmPayload: any, toUid?: ToOptions) => {
88
+ const to = typeof toUid == 'string' ? parseInt(toUid) : toUid;
89
+
88
90
  const text = JSON.stringify({
89
91
  type: eventMessageType.CUSTOM_EVENT,
90
92
  msg: rtmPayload,
@@ -105,7 +107,7 @@ class CustomEvents {
105
107
  }
106
108
  }
107
109
  // Case 2: send to indivdual
108
- if (typeof to === 'number' && to > 0) {
110
+ if (typeof to === 'number' && to !== 0) {
109
111
  console.log('CUSTOM_EVENT_API: case 2 executed', to);
110
112
  const adjustedUID = adjustUID(to);
111
113
  try {