@gustavo-valsechi/client 1.4.289 → 1.4.290

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.
@@ -117,8 +117,9 @@ const TargetProviderContainer = ({ children }) => {
117
117
  insideMemory.push(index);
118
118
  };
119
119
  const add = (target) => {
120
- const exists = import_lodash.default.find(memory, (data) => data.ref.current === target.ref.current);
121
- if (exists) return;
120
+ const existsInMemory = import_lodash.default.find(memory, (data) => data.ref.current === target.ref.current);
121
+ const existsInTarget = import_lodash.default.find(targets, (data) => data.ref.current === target.ref.current);
122
+ if (existsInMemory || existsInTarget) return;
122
123
  memory.push(target);
123
124
  console.log("memory", [...memory]);
124
125
  setTargets([...memory]);
@@ -83,8 +83,9 @@ const TargetProviderContainer = ({ children }) => {
83
83
  insideMemory.push(index);
84
84
  };
85
85
  const add = (target) => {
86
- const exists = _.find(memory, (data) => data.ref.current === target.ref.current);
87
- if (exists) return;
86
+ const existsInMemory = _.find(memory, (data) => data.ref.current === target.ref.current);
87
+ const existsInTarget = _.find(targets, (data) => data.ref.current === target.ref.current);
88
+ if (existsInMemory || existsInTarget) return;
88
89
  memory.push(target);
89
90
  console.log("memory", [...memory]);
90
91
  setTargets([...memory]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gustavo-valsechi/client",
3
- "version": "1.4.289",
3
+ "version": "1.4.290",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",