contentoh-components-library 21.3.20 → 21.3.22
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/.env.development +0 -2
- package/.env.production +2 -2
- package/dist/components/organisms/Chat/ContentChat/index.js +17 -9
- package/dist/components/organisms/Chat/Footer/index.js +2 -2
- package/package.json +1 -1
- package/src/components/organisms/Chat/ContentChat/index.js +2 -2
- package/src/components/organisms/Chat/Footer/index.js +2 -2
package/.env.development
CHANGED
|
@@ -31,5 +31,3 @@ REACT_APP_KUTS3=AKIA5CPHLQTTS22HCGHW
|
|
|
31
31
|
REACT_APP_AKUTS3=RSpwEaM0fsLEgN7BJzRyCKqyU0lNExTsPUvxyNXm
|
|
32
32
|
REACT_APP_USER_POOL_ID=us-east-1_XMZQdqkGj
|
|
33
33
|
REACT_APP_USER_POOL_WEB_CLIENT_ID=5ac8tpgs6gbsq13frvrpieep40
|
|
34
|
-
REACT_APP_KEY_UPLOAD_TO_S3=AKIA5CPHLQTTYNYWQ2TM
|
|
35
|
-
REACT_APP_ACCESS_KEY_UPLOAD_TO_S3=zGYWR4rW52rqg1bW1CrC00zBXv2od0mNCF8WGcvr
|
package/.env.production
CHANGED
|
@@ -24,7 +24,7 @@ REACT_APP_PENDING_INVITATIONS=https://3v43slee1m.execute-api.us-east-1.amazonaws
|
|
|
24
24
|
|
|
25
25
|
REACT_APP_IMAGES_BUCKET=content-management-images-prod
|
|
26
26
|
REACT_APP_IMAGES_PROFILE_BUCKET=content-management-profile-prod
|
|
27
|
-
REACT_APP_KUTS3=
|
|
28
|
-
REACT_APP_AKUTS3=
|
|
27
|
+
REACT_APP_KUTS3=AKIA5CPHLQTTS22HCGHW
|
|
28
|
+
REACT_APP_AKUTS3=RSpwEaM0fsLEgN7BJzRyCKqyU0lNExTsPUvxyNXm
|
|
29
29
|
REACT_APP_USER_POOL_ID=us-east-1_XMZQdqkGj
|
|
30
30
|
REACT_APP_USER_POOL_WEB_CLIENT_ID=5ac8tpgs6gbsq13frvrpieep40
|
|
@@ -204,7 +204,7 @@ var ContentChat = function ContentChat(props) {
|
|
|
204
204
|
setRunUpdate(function (prev) {
|
|
205
205
|
return prev + 1;
|
|
206
206
|
});
|
|
207
|
-
},
|
|
207
|
+
}, 15000);
|
|
208
208
|
setProcessUpdateID(processID);
|
|
209
209
|
return function () {
|
|
210
210
|
return clearTimeout(processID);
|
|
@@ -212,7 +212,6 @@ var ContentChat = function ContentChat(props) {
|
|
|
212
212
|
}, [startUpdate]); // ejecutar update
|
|
213
213
|
|
|
214
214
|
(0, _react.useEffect)(function () {
|
|
215
|
-
// if (runUpdate == 0) return;
|
|
216
215
|
if (chatType === "merchant_product") {
|
|
217
216
|
if (singleChat.items) getUpdateLatestMerchantProduct();else getInitialMerchantProduct();
|
|
218
217
|
} else if (chatType === "order_product") {
|
|
@@ -824,6 +823,15 @@ var ContentChat = function ContentChat(props) {
|
|
|
824
823
|
switch (_context9.prev = _context9.next) {
|
|
825
824
|
case 0:
|
|
826
825
|
fromUpdate = _args9.length > 0 && _args9[0] !== undefined ? _args9[0] : false;
|
|
826
|
+
|
|
827
|
+
if (!(singleChat.statusChat === "closed")) {
|
|
828
|
+
_context9.next = 3;
|
|
829
|
+
break;
|
|
830
|
+
}
|
|
831
|
+
|
|
832
|
+
return _context9.abrupt("return");
|
|
833
|
+
|
|
834
|
+
case 3:
|
|
827
835
|
dataUser = {
|
|
828
836
|
id: (_dataChat$currentUser9 = dataChat.currentUser) === null || _dataChat$currentUser9 === void 0 ? void 0 : _dataChat$currentUser9.id,
|
|
829
837
|
companyId: (_dataChat$currentUser10 = dataChat.currentUser) === null || _dataChat$currentUser10 === void 0 ? void 0 : _dataChat$currentUser10.companyId,
|
|
@@ -836,12 +844,12 @@ var ContentChat = function ContentChat(props) {
|
|
|
836
844
|
currentUser: (0, _utils.encodeUriJson)(dataUser),
|
|
837
845
|
currentItemsFront: (0, _utils.encodeUriJson)(getItemsIdSingleChat())
|
|
838
846
|
};
|
|
839
|
-
_context9.next =
|
|
847
|
+
_context9.next = 7;
|
|
840
848
|
return (0, _handle_http.fetchGET)(process.env.REACT_APP_TICKETS_CHAT_ENDPOINT, paramsQuery, {
|
|
841
849
|
Authorization: (_dataChat$currentUser12 = dataChat.currentUser) === null || _dataChat$currentUser12 === void 0 ? void 0 : _dataChat$currentUser12.token
|
|
842
850
|
});
|
|
843
851
|
|
|
844
|
-
case
|
|
852
|
+
case 7:
|
|
845
853
|
response = _context9.sent;
|
|
846
854
|
//programar update en 20s
|
|
847
855
|
setStartUpdate(function (prev) {
|
|
@@ -849,7 +857,7 @@ var ContentChat = function ContentChat(props) {
|
|
|
849
857
|
});
|
|
850
858
|
|
|
851
859
|
if (response.body) {
|
|
852
|
-
_context9.next =
|
|
860
|
+
_context9.next = 13;
|
|
853
861
|
break;
|
|
854
862
|
}
|
|
855
863
|
|
|
@@ -873,7 +881,7 @@ var ContentChat = function ContentChat(props) {
|
|
|
873
881
|
});
|
|
874
882
|
return _context9.abrupt("return");
|
|
875
883
|
|
|
876
|
-
case
|
|
884
|
+
case 13:
|
|
877
885
|
// limpiar error update
|
|
878
886
|
if (errorUpdate.startDate) {
|
|
879
887
|
setErrorUpdate({});
|
|
@@ -885,19 +893,19 @@ var ContentChat = function ContentChat(props) {
|
|
|
885
893
|
updateAllUsers(response.body.users); // actualizar los items del chat
|
|
886
894
|
|
|
887
895
|
if (!(response.body.items.length === 0)) {
|
|
888
|
-
_context9.next =
|
|
896
|
+
_context9.next = 18;
|
|
889
897
|
break;
|
|
890
898
|
}
|
|
891
899
|
|
|
892
900
|
return _context9.abrupt("return");
|
|
893
901
|
|
|
894
|
-
case
|
|
902
|
+
case 18:
|
|
895
903
|
newSingleChat = (0, _objectSpread3.default)({}, singleChat);
|
|
896
904
|
newSingleChat.items = addNewItemsChat(newSingleChat.items, response.body.items, fromUpdate);
|
|
897
905
|
newSingleChat.statusChat = response.body.data.statusChat;
|
|
898
906
|
setSingleChat(newSingleChat);
|
|
899
907
|
|
|
900
|
-
case
|
|
908
|
+
case 22:
|
|
901
909
|
case "end":
|
|
902
910
|
return _context9.stop();
|
|
903
911
|
}
|
|
@@ -63,8 +63,8 @@ var S3_BUCKET = process.env.REACT_APP_IMAGES_BUCKET;
|
|
|
63
63
|
var REGION = "us-east-1";
|
|
64
64
|
|
|
65
65
|
_awsSdk.default.config.update({
|
|
66
|
-
accessKeyId: process.env.
|
|
67
|
-
secretAccessKey: process.env.
|
|
66
|
+
accessKeyId: process.env.REACT_APP_KUTS3,
|
|
67
|
+
secretAccessKey: process.env.REACT_APP_AKUTS3
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
var myBucket = new _awsSdk.default.S3({
|
package/package.json
CHANGED
|
@@ -100,14 +100,13 @@ export const ContentChat = (props) => {
|
|
|
100
100
|
if (startUpdate == 0) return;
|
|
101
101
|
const processID = setTimeout(() => {
|
|
102
102
|
setRunUpdate((prev) => prev + 1);
|
|
103
|
-
},
|
|
103
|
+
}, 15000);
|
|
104
104
|
setProcessUpdateID(processID);
|
|
105
105
|
return () => clearTimeout(processID);
|
|
106
106
|
}, [startUpdate]);
|
|
107
107
|
|
|
108
108
|
// ejecutar update
|
|
109
109
|
useEffect(() => {
|
|
110
|
-
// if (runUpdate == 0) return;
|
|
111
110
|
if (chatType === "merchant_product") {
|
|
112
111
|
if (singleChat.items) getUpdateLatestMerchantProduct();
|
|
113
112
|
else getInitialMerchantProduct();
|
|
@@ -489,6 +488,7 @@ export const ContentChat = (props) => {
|
|
|
489
488
|
};
|
|
490
489
|
|
|
491
490
|
const getUpdateLatestTicket = async (fromUpdate = false) => {
|
|
491
|
+
if (singleChat.statusChat === "closed") return;
|
|
492
492
|
const dataUser = {
|
|
493
493
|
id: dataChat.currentUser?.id,
|
|
494
494
|
companyId: dataChat.currentUser?.companyId,
|
|
@@ -45,8 +45,8 @@ const S3_BUCKET = process.env.REACT_APP_IMAGES_BUCKET;
|
|
|
45
45
|
const REGION = "us-east-1";
|
|
46
46
|
|
|
47
47
|
AWS.config.update({
|
|
48
|
-
accessKeyId: process.env.
|
|
49
|
-
secretAccessKey: process.env.
|
|
48
|
+
accessKeyId: process.env.REACT_APP_KUTS3,
|
|
49
|
+
secretAccessKey: process.env.REACT_APP_AKUTS3,
|
|
50
50
|
});
|
|
51
51
|
|
|
52
52
|
const myBucket = new AWS.S3({
|