agora-appbuilder-core 4.0.31-beta-3 → 4.0.31-beta-4

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": "4.0.31-beta-3",
3
+ "version": "4.0.31-beta-4",
4
4
  "description": "React Native template for RTE app builder",
5
5
  "main": "index.js",
6
6
  "files": [
@@ -89,12 +89,17 @@ const ChatConfigure = ({children}) => {
89
89
  addReactionToPrivateStore,
90
90
  addReactionToStore,
91
91
  } = useChatMessages();
92
- const {setPinMsgId, setPinnedByUser} = useChatUIControls();
92
+ const {setPinMsgId, setPinnedByUser, privateChatUser} = useChatUIControls();
93
+ const privateChatUserRef = React.useRef(privateChatUser);
93
94
 
94
95
  React.useEffect(() => {
95
96
  defaultContentRef.current = defaultContent;
96
97
  }, [defaultContent]);
97
98
 
99
+ React.useEffect(() => {
100
+ privateChatUserRef.current = privateChatUser;
101
+ }, [privateChatUser]);
102
+
98
103
  useEffect(() => {
99
104
  const logout = async () => {
100
105
  try {
@@ -296,9 +301,11 @@ const ChatConfigure = ({children}) => {
296
301
  if (convId === data.chat.group_id) {
297
302
  addReactionToStore(msgId, reactions as unknown as Reaction[]);
298
303
  } else {
299
- const userId = operations[0].userId;
304
+ const fromUserID = operations[0].userId;
305
+ const uid =
306
+ localUid === fromUserID ? privateChatUserRef.current : fromUserID;
300
307
  addReactionToPrivateStore(
301
- Number(userId),
308
+ uid,
302
309
  msgId,
303
310
  reactions as unknown as Reaction[],
304
311
  );
@@ -346,6 +346,7 @@ const ChatContainer = (props?: {
346
346
  ext={message?.ext}
347
347
  reactions={message?.reactions}
348
348
  replyToMsgId={message?.replyToMsgId}
349
+ scrollOffset={scrollOffset}
349
350
  isLastMsg={
350
351
  privateMessageStore[privateChatUser].length - 1 ===
351
352
  index