seat-editor 3.6.42 → 3.6.44

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.
@@ -2,7 +2,7 @@
2
2
  import { useCallback, useEffect, useRef, useState } from "react";
3
3
  import { rotatePoint, snap } from "./utils";
4
4
  import { useAppSelector } from "../../hooks/use-redux";
5
- import { isEqual } from "lodash";
5
+ import { isEmpty, isEqual } from "lodash";
6
6
  export const useConnectionGraph = ({ svgRef, onEdgesChange, keyNode, mappingKey, initialEdges, onTableMainConnection, groupSelection, }) => {
7
7
  const components = useAppSelector((state) => state.board.components);
8
8
  const [edges, setEdges] = useState([]);
@@ -167,6 +167,8 @@ export const useConnectionGraph = ({ svgRef, onEdgesChange, keyNode, mappingKey,
167
167
  const hasInitialEdges = useRef(false);
168
168
  const prevInitialEdgesRef = useRef(initialEdges);
169
169
  useEffect(() => {
170
+ if (isEmpty(components) || !initialEdges || !groupSelection || !mappingKey)
171
+ return;
170
172
  const allElements = components === null || components === void 0 ? void 0 : components.map((table) => {
171
173
  if (mappingKey && (table === null || table === void 0 ? void 0 : table[mappingKey])) {
172
174
  return Object.assign({}, table === null || table === void 0 ? void 0 : table[mappingKey]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seat-editor",
3
- "version": "3.6.42",
3
+ "version": "3.6.44",
4
4
  "private": false,
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",