awing-library 2.1.18 → 2.1.19

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.
@@ -46,10 +46,8 @@ var react_i18next_1 = require("react-i18next");
46
46
  var recoil_1 = require("recoil");
47
47
  var AWING_1 = require("../../../AWING");
48
48
  var Recoils_1 = require("./Recoils");
49
- var Hooks_1 = __importDefault(require("../Hooks"));
50
49
  var i18n_1 = __importDefault(require("../../../i18n"));
51
50
  var Infomation = function () {
52
- var service = (0, Hooks_1.default)().service;
53
51
  var directories = (0, recoil_1.useRecoilValue)(Recoils_1.directoriesState);
54
52
  var attributes = (0, recoil_1.useRecoilValue)(Recoils_1.attributesState);
55
53
  var _a = (0, recoil_1.useRecoilState)(Recoils_1.campaignState), campaign = _a[0], setCampaign = _a[1];
@@ -65,12 +63,6 @@ var Infomation = function () {
65
63
  }
66
64
  // eslint-disable-next-line react-hooks/exhaustive-deps
67
65
  }, [directories]);
68
- (0, react_1.useEffect)(function () {
69
- if (!service.attributesGetByObjectTypeCode) {
70
- setCampaignAttributes([""]);
71
- }
72
- // eslint-disable-next-line react-hooks/exhaustive-deps
73
- }, [service]);
74
66
  var handleUpdate = (0, react_1.useCallback)(function (obj, formValid, fieldUpdate) {
75
67
  if (fieldUpdate) {
76
68
  if (fieldUpdate === 'attributeIds') {
@@ -76,6 +76,12 @@ var CreateOrEdit = function () {
76
76
  ? Constant_1.Constants.CAMPAIGN_CLONE
77
77
  : Constant_1.Constants.CAMPAIGN_CREATE;
78
78
  }, [location.pathname, campaignId]);
79
+ (0, react_1.useEffect)(function () {
80
+ if (!service.attributesGetByObjectTypeCode && !campaignData.campaignAttributes.length) {
81
+ setCampaignData(function (prev) { return (__assign(__assign({}, prev), { campaignAttributes: [""] })); });
82
+ }
83
+ // eslint-disable-next-line react-hooks/exhaustive-deps
84
+ }, [service, campaignData.campaignAttributes]);
79
85
  (0, react_1.useEffect)(function () {
80
86
  setLoading(true);
81
87
  Promise.all([getCampaignData(), getPage()]).finally(function () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "awing-library",
3
- "version": "2.1.18",
3
+ "version": "2.1.19",
4
4
  "description": "",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",