whyuzeim 1.1.35 → 1.1.38

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.
@@ -12,7 +12,6 @@ var _asyncToGenerator = require('@babel/runtime-corejs3/helpers/esm/asyncToGener
12
12
  var _defineProperty = require('@babel/runtime-corejs3/helpers/esm/defineProperty');
13
13
  var _slicedToArray = require('@babel/runtime-corejs3/helpers/esm/slicedToArray');
14
14
  var _regeneratorRuntime = require('@babel/runtime-corejs3/regenerator');
15
- var _JSON$stringify = require('@babel/runtime-corejs3/core-js-stable/json/stringify');
16
15
  var _findInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/find');
17
16
  var _forEachInstanceProperty = require('@babel/runtime-corejs3/core-js-stable/instance/for-each');
18
17
  var _setInterval = require('@babel/runtime-corejs3/core-js-stable/set-interval');
@@ -38,9 +37,9 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
38
37
  var _useSDK = agoraChatUikit.useSDK(),
39
38
  MessageSDK = _useSDK.ChatSDK;
40
39
  var manulLoginRef = React.useRef(false);
41
- var _useConversationConte = agoraChatUikit.useConversationContext(),
42
- i = _useConversationConte.currentConversation;
43
- console.log(_JSON$stringify(i), 'dfsfs');
40
+ var _useConversationConte = agoraChatUikit.useConversationContext();
41
+ _useConversationConte.currentConversation;
42
+ var conversationList = _useConversationConte.conversationList;
44
43
  var _useContext = React.useContext(context.Context),
45
44
  http = _useContext.http,
46
45
  userInfo = _useContext.userInfo;
@@ -138,9 +137,6 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
138
137
  }, formatMessageTime(msg.time)));
139
138
  };
140
139
  var _renderMessage = function renderMessage(msg) {
141
- var cuiScrollList = document.querySelector(".cui-scrollList div");
142
- var generatingLoader = document.querySelector("#agent-generating-loader");
143
- if (cuiScrollList && generatingLoader && msg.to !== (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.conversationId)) ;
144
140
  if (msg.type === "txt") {
145
141
  return renderTxtMsg(msg);
146
142
  } else if (msg.type === "img") {
@@ -434,6 +430,16 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
434
430
  return _ref4.apply(this, arguments);
435
431
  };
436
432
  }();
433
+ React.useEffect(function () {
434
+ var _conversationList$fin;
435
+ var cuiScrollList = document.querySelector(".cui-scrollList div");
436
+ var generatingLoader = document.querySelector("#agent-generating-loader");
437
+ if (cuiScrollList && generatingLoader && ((_conversationList$fin = _findInstanceProperty(conversationList).call(conversationList, function (item) {
438
+ return item.conversationId === props.conversationId;
439
+ })) === null || _conversationList$fin === void 0 || (_conversationList$fin = _conversationList$fin.lastMessage) === null || _conversationList$fin === void 0 ? void 0 : _conversationList$fin.to) !== props.conversationId) {
440
+ cuiScrollList.removeChild(generatingLoader);
441
+ }
442
+ }, [conversationList, props.conversationId]);
437
443
  return /*#__PURE__*/React.createElement("div", {
438
444
  className: "bg-[var(--im-main-backgroundColor)] im-agent-mid ".concat((_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : "", " w-full h-full overflow-hidden flex flex-col")
439
445
  }, loading ? /*#__PURE__*/React.createElement("div", {
@@ -10,7 +10,6 @@ import _asyncToGenerator from '@babel/runtime-corejs3/helpers/esm/asyncToGenerat
10
10
  import _defineProperty from '@babel/runtime-corejs3/helpers/esm/defineProperty';
11
11
  import _slicedToArray from '@babel/runtime-corejs3/helpers/esm/slicedToArray';
12
12
  import _regeneratorRuntime from '@babel/runtime-corejs3/regenerator';
13
- import _JSON$stringify from '@babel/runtime-corejs3/core-js-stable/json/stringify';
14
13
  import _findInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/find';
15
14
  import _forEachInstanceProperty from '@babel/runtime-corejs3/core-js-stable/instance/for-each';
16
15
  import _setInterval from '@babel/runtime-corejs3/core-js-stable/set-interval';
@@ -36,9 +35,9 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
36
35
  var _useSDK = useSDK(),
37
36
  MessageSDK = _useSDK.ChatSDK;
38
37
  var manulLoginRef = useRef(false);
39
- var _useConversationConte = useConversationContext(),
40
- i = _useConversationConte.currentConversation;
41
- console.log(_JSON$stringify(i), 'dfsfs');
38
+ var _useConversationConte = useConversationContext();
39
+ _useConversationConte.currentConversation;
40
+ var conversationList = _useConversationConte.conversationList;
42
41
  var _useContext = useContext(Context),
43
42
  http = _useContext.http,
44
43
  userInfo = _useContext.userInfo;
@@ -136,9 +135,6 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
136
135
  }, formatMessageTime(msg.time)));
137
136
  };
138
137
  var _renderMessage = function renderMessage(msg) {
139
- var cuiScrollList = document.querySelector(".cui-scrollList div");
140
- var generatingLoader = document.querySelector("#agent-generating-loader");
141
- if (cuiScrollList && generatingLoader && msg.to !== (currentConversation === null || currentConversation === void 0 ? void 0 : currentConversation.conversationId)) ;
142
138
  if (msg.type === "txt") {
143
139
  return renderTxtMsg(msg);
144
140
  } else if (msg.type === "img") {
@@ -432,6 +428,16 @@ var HighlyCustomChat = function HighlyCustomChat(props) {
432
428
  return _ref4.apply(this, arguments);
433
429
  };
434
430
  }();
431
+ useEffect(function () {
432
+ var _conversationList$fin;
433
+ var cuiScrollList = document.querySelector(".cui-scrollList div");
434
+ var generatingLoader = document.querySelector("#agent-generating-loader");
435
+ if (cuiScrollList && generatingLoader && ((_conversationList$fin = _findInstanceProperty(conversationList).call(conversationList, function (item) {
436
+ return item.conversationId === props.conversationId;
437
+ })) === null || _conversationList$fin === void 0 || (_conversationList$fin = _conversationList$fin.lastMessage) === null || _conversationList$fin === void 0 ? void 0 : _conversationList$fin.to) !== props.conversationId) {
438
+ cuiScrollList.removeChild(generatingLoader);
439
+ }
440
+ }, [conversationList, props.conversationId]);
435
441
  return /*#__PURE__*/React.createElement("div", {
436
442
  className: "bg-[var(--im-main-backgroundColor)] im-agent-mid ".concat((_props$className = props.className) !== null && _props$className !== void 0 ? _props$className : "", " w-full h-full overflow-hidden flex flex-col")
437
443
  }, loading ? /*#__PURE__*/React.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whyuzeim",
3
- "version": "1.1.35",
3
+ "version": "1.1.38",
4
4
  "description": "im componenets",
5
5
  "main": "cjs/index.js",
6
6
  "module": "es/index.js",