whyuzeim 1.0.15 → 1.0.17
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/cjs/ChatBox/index.js
CHANGED
|
@@ -392,14 +392,30 @@ var Chatbox = function Chatbox(props) {
|
|
|
392
392
|
}
|
|
393
393
|
});
|
|
394
394
|
} else {
|
|
395
|
-
|
|
395
|
+
var _userInfo = agoraChatUikit.rootStore.addressStore.appUsersInfo[cvs.conversationId];
|
|
396
|
+
if (!_userInfo || !_userInfo.avatarurl || !_userInfo.name) {
|
|
397
|
+
client.fetchUserInfoById([cvs.conversationId], ["nickname", "avatarurl", "mail", "phone", "gender", "sign", "birth", "ext"]).then(function (res) {
|
|
398
|
+
setHeaderInfo(function (prevState) {
|
|
399
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
400
|
+
headerImageURL: res.data[cvs.conversationId].avatarurl,
|
|
401
|
+
conversationName: res.data[cvs.conversationId].nickname
|
|
402
|
+
});
|
|
403
|
+
});
|
|
404
|
+
var tempUserInfo = agoraChatUikit.rootStore.addressStore.appUsersInfo[cvs.conversationId];
|
|
405
|
+
agoraChatUikit.rootStore.addressStore.appUsersInfo[cvs.conversationId] = _objectSpread(_objectSpread({}, tempUserInfo || {}), {}, {
|
|
406
|
+
userId: cvs.conversationId,
|
|
407
|
+
name: res.data[cvs.conversationId].nickname,
|
|
408
|
+
avatarurl: res.data[cvs.conversationId].avatarurl
|
|
409
|
+
});
|
|
410
|
+
});
|
|
411
|
+
} else {
|
|
396
412
|
setHeaderInfo(function (prevState) {
|
|
397
413
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
398
|
-
headerImageURL:
|
|
399
|
-
conversationName:
|
|
414
|
+
headerImageURL: _userInfo.avatarurl,
|
|
415
|
+
conversationName: _userInfo.name
|
|
400
416
|
});
|
|
401
417
|
});
|
|
402
|
-
}
|
|
418
|
+
}
|
|
403
419
|
}
|
|
404
420
|
};
|
|
405
421
|
function getShareGroupInfo(_x2, _x3) {
|
|
@@ -58,10 +58,22 @@ var CustomConversationItem = function CustomConversationItem(props) {
|
|
|
58
58
|
if (!cvs || !cvs.conversationId) {
|
|
59
59
|
return;
|
|
60
60
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
var userInfo = agoraChatUikit.rootStore.addressStore.appUsersInfo[cvs.conversationId];
|
|
62
|
+
if (!userInfo || !userInfo.avatarurl || !userInfo.name) {
|
|
63
|
+
client.fetchUserInfoById([cvs.conversationId], ["nickname", "avatarurl", "mail", "phone", "gender", "sign", "birth", "ext"]).then(function (res) {
|
|
64
|
+
setAvatar(res.data[cvs.conversationId].avatarurl);
|
|
65
|
+
setName(res.data[cvs.conversationId].nickname);
|
|
66
|
+
var tempUserInfo = agoraChatUikit.rootStore.addressStore.appUsersInfo[cvs.conversationId];
|
|
67
|
+
agoraChatUikit.rootStore.addressStore.appUsersInfo[cvs.conversationId] = _objectSpread(_objectSpread({}, tempUserInfo || {}), {}, {
|
|
68
|
+
userId: cvs.conversationId,
|
|
69
|
+
name: res.data[cvs.conversationId].nickname,
|
|
70
|
+
avatarurl: res.data[cvs.conversationId].avatarurl
|
|
71
|
+
});
|
|
72
|
+
});
|
|
73
|
+
} else {
|
|
74
|
+
setAvatar(userInfo.avatarurl);
|
|
75
|
+
setName(userInfo.name);
|
|
76
|
+
}
|
|
65
77
|
}
|
|
66
78
|
}, [client, cvs, cvs.chatType, cvs.conversationId, http]);
|
|
67
79
|
return /*#__PURE__*/React.createElement(agoraChatUikit.ConversationItem, {
|
package/es/ChatBox/index.js
CHANGED
|
@@ -390,14 +390,30 @@ var Chatbox = function Chatbox(props) {
|
|
|
390
390
|
}
|
|
391
391
|
});
|
|
392
392
|
} else {
|
|
393
|
-
|
|
393
|
+
var _userInfo = rootStore.addressStore.appUsersInfo[cvs.conversationId];
|
|
394
|
+
if (!_userInfo || !_userInfo.avatarurl || !_userInfo.name) {
|
|
395
|
+
client.fetchUserInfoById([cvs.conversationId], ["nickname", "avatarurl", "mail", "phone", "gender", "sign", "birth", "ext"]).then(function (res) {
|
|
396
|
+
setHeaderInfo(function (prevState) {
|
|
397
|
+
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
398
|
+
headerImageURL: res.data[cvs.conversationId].avatarurl,
|
|
399
|
+
conversationName: res.data[cvs.conversationId].nickname
|
|
400
|
+
});
|
|
401
|
+
});
|
|
402
|
+
var tempUserInfo = rootStore.addressStore.appUsersInfo[cvs.conversationId];
|
|
403
|
+
rootStore.addressStore.appUsersInfo[cvs.conversationId] = _objectSpread(_objectSpread({}, tempUserInfo || {}), {}, {
|
|
404
|
+
userId: cvs.conversationId,
|
|
405
|
+
name: res.data[cvs.conversationId].nickname,
|
|
406
|
+
avatarurl: res.data[cvs.conversationId].avatarurl
|
|
407
|
+
});
|
|
408
|
+
});
|
|
409
|
+
} else {
|
|
394
410
|
setHeaderInfo(function (prevState) {
|
|
395
411
|
return _objectSpread(_objectSpread({}, prevState), {}, {
|
|
396
|
-
headerImageURL:
|
|
397
|
-
conversationName:
|
|
412
|
+
headerImageURL: _userInfo.avatarurl,
|
|
413
|
+
conversationName: _userInfo.name
|
|
398
414
|
});
|
|
399
415
|
});
|
|
400
|
-
}
|
|
416
|
+
}
|
|
401
417
|
}
|
|
402
418
|
};
|
|
403
419
|
function getShareGroupInfo(_x2, _x3) {
|
|
@@ -56,10 +56,22 @@ var CustomConversationItem = function CustomConversationItem(props) {
|
|
|
56
56
|
if (!cvs || !cvs.conversationId) {
|
|
57
57
|
return;
|
|
58
58
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
59
|
+
var userInfo = rootStore.addressStore.appUsersInfo[cvs.conversationId];
|
|
60
|
+
if (!userInfo || !userInfo.avatarurl || !userInfo.name) {
|
|
61
|
+
client.fetchUserInfoById([cvs.conversationId], ["nickname", "avatarurl", "mail", "phone", "gender", "sign", "birth", "ext"]).then(function (res) {
|
|
62
|
+
setAvatar(res.data[cvs.conversationId].avatarurl);
|
|
63
|
+
setName(res.data[cvs.conversationId].nickname);
|
|
64
|
+
var tempUserInfo = rootStore.addressStore.appUsersInfo[cvs.conversationId];
|
|
65
|
+
rootStore.addressStore.appUsersInfo[cvs.conversationId] = _objectSpread(_objectSpread({}, tempUserInfo || {}), {}, {
|
|
66
|
+
userId: cvs.conversationId,
|
|
67
|
+
name: res.data[cvs.conversationId].nickname,
|
|
68
|
+
avatarurl: res.data[cvs.conversationId].avatarurl
|
|
69
|
+
});
|
|
70
|
+
});
|
|
71
|
+
} else {
|
|
72
|
+
setAvatar(userInfo.avatarurl);
|
|
73
|
+
setName(userInfo.name);
|
|
74
|
+
}
|
|
63
75
|
}
|
|
64
76
|
}, [client, cvs, cvs.chatType, cvs.conversationId, http]);
|
|
65
77
|
return /*#__PURE__*/React.createElement(ConversationItem, {
|