@gustavo-valsechi/client 1.4.161 → 1.4.163

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.
@@ -66,20 +66,31 @@ const ModalProviderContainer = ({ children }) => {
66
66
  removeModal(modalName);
67
67
  };
68
68
  const setProps = (modalName, props) => {
69
- const index = import_lodash.default.findIndex(modals, (modal) => modal.name === modalName);
70
- const content = import_lodash.default.find(modals, (modal) => modal.name === modalName);
69
+ var _a;
70
+ const index = import_lodash.default.findIndex(memory, (modal) => modal.name === modalName);
71
+ const content = import_lodash.default.find(memory, (modal) => modal.name === modalName);
72
+ console.log(memory);
73
+ console.log(content);
71
74
  if (!content) return;
72
- let settedModals = [...modals];
73
- settedModals.splice(index, 1, { ...content, props: { ...content.props, ...props } });
74
- setModals(settedModals);
75
+ memory.splice(index, 1, {
76
+ ...content,
77
+ props: {
78
+ ...content.props,
79
+ ...props,
80
+ content: {
81
+ ...((_a = content.props) == null ? void 0 : _a.content) || {},
82
+ ...props.content
83
+ }
84
+ }
85
+ });
86
+ setModals(memory);
75
87
  };
76
88
  const toggle = (modalName) => {
77
89
  var _a;
78
- const content = import_lodash.default.find(modals, (modal) => modal.name === modalName);
90
+ const content = import_lodash.default.find(memory, (modal) => modal.name === modalName);
79
91
  if (!content) return;
80
92
  setProps(modalName, { toggle: !((_a = content == null ? void 0 : content.props) == null ? void 0 : _a.toggle) });
81
93
  };
82
- console.log(modals);
83
94
  return /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(
84
95
  ModalContext.Provider,
85
96
  {
@@ -32,20 +32,31 @@ const ModalProviderContainer = ({ children }) => {
32
32
  removeModal(modalName);
33
33
  };
34
34
  const setProps = (modalName, props) => {
35
- const index = _.findIndex(modals, (modal) => modal.name === modalName);
36
- const content = _.find(modals, (modal) => modal.name === modalName);
35
+ var _a;
36
+ const index = _.findIndex(memory, (modal) => modal.name === modalName);
37
+ const content = _.find(memory, (modal) => modal.name === modalName);
38
+ console.log(memory);
39
+ console.log(content);
37
40
  if (!content) return;
38
- let settedModals = [...modals];
39
- settedModals.splice(index, 1, { ...content, props: { ...content.props, ...props } });
40
- setModals(settedModals);
41
+ memory.splice(index, 1, {
42
+ ...content,
43
+ props: {
44
+ ...content.props,
45
+ ...props,
46
+ content: {
47
+ ...((_a = content.props) == null ? void 0 : _a.content) || {},
48
+ ...props.content
49
+ }
50
+ }
51
+ });
52
+ setModals(memory);
41
53
  };
42
54
  const toggle = (modalName) => {
43
55
  var _a;
44
- const content = _.find(modals, (modal) => modal.name === modalName);
56
+ const content = _.find(memory, (modal) => modal.name === modalName);
45
57
  if (!content) return;
46
58
  setProps(modalName, { toggle: !((_a = content == null ? void 0 : content.props) == null ? void 0 : _a.toggle) });
47
59
  };
48
- console.log(modals);
49
60
  return /* @__PURE__ */ jsxs(
50
61
  ModalContext.Provider,
51
62
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.161",
3
+ "version": "1.4.163",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",