awing-library 2.1.132 → 2.1.133

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.
@@ -71,7 +71,6 @@ var ViewContent = function (_a) {
71
71
  var _h = react_1.default.useState(''), scriptValidationTemplate = _h[0], setScriptValidationTemplate = _h[1];
72
72
  var _j = react_1.default.useState(''), scriptAutoField = _j[0], setScriptAutoField = _j[1];
73
73
  var _k = react_1.default.useState(false), loading = _k[0], setLoading = _k[1];
74
- var isUniq = react_1.default.useRef(false);
75
74
  var rootDirectory = (0, recoil_1.useRecoilValue)(Recoil_1.pageRootDeirectory);
76
75
  // const [events, setEvent] = useRecoilState(pageEventState)
77
76
  react_1.default.useEffect(function () {
@@ -86,24 +85,10 @@ var ViewContent = function (_a) {
86
85
  }
87
86
  // eslint-disable-next-line react-hooks/exhaustive-deps
88
87
  }, [viewInfoData.templateId]);
89
- react_1.default.useEffect(function () {
90
- if (!isUniq.current) {
91
- onChange(['events'], (0, lodash_1.uniqBy)(viewInfoData.events, function (a) {
92
- return JSON.stringify({
93
- event: a.event,
94
- viewNumber: a.viewNumber,
95
- pageId: a.pageId,
96
- });
97
- }));
98
- isUniq.current = true;
99
- }
100
- // eslint-disable-next-line react-hooks/exhaustive-deps
101
- }, [viewInfoData.events]);
102
88
  var handleResData = function (res) {
103
89
  var _a;
104
90
  onChange(['viewDatas'], (0, Utils_1.getTemplateDatas)(res.templateParameters, viewInfoData, pageId, viewNumber));
105
- onChange(['events'], __spreadArray(__spreadArray([], (_a = res === null || res === void 0 ? void 0 : res.templateEvents) === null || _a === void 0 ? void 0 : _a.map(function (item) { return ({ id: item.id, event: item.event, pageId: pageId, protected: true }); }), true), viewInfoData.events, true));
106
- isUniq.current = false;
91
+ onChange(['events'], (0, lodash_1.uniqBy)(__spreadArray(__spreadArray([], (_a = res === null || res === void 0 ? void 0 : res.templateEvents) === null || _a === void 0 ? void 0 : _a.map(function (item) { return ({ id: item.id, event: item.event, pageId: pageId, protected: true }); }), true), viewInfoData.events, true), 'event'));
107
92
  onChange(['templateValidation'], res.template.validation);
108
93
  onChange(['templateHandleEvent'], res.template.autoField);
109
94
  setScriptValidationTemplate(res.template.validation || '');
@@ -168,7 +153,6 @@ var ViewContent = function (_a) {
168
153
  appHelper.snackbar('error', errorMessage);
169
154
  }, onUploadFile: onUploadFile, onChangeEvent: function (values) {
170
155
  onChange(['events'], values);
171
- isUniq.current = false;
172
156
  } }) }) })) })) }));
173
157
  };
174
158
  exports.default = ViewContent;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.132",
3
+ "version": "2.1.133",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",