fix(codeTabsComponent): add condition to check if data is truthy before executing code block
fix(codeAreaModal): remove unused isTweakPage variable from useContext fix(reactflowUtils): remove unnecessary null assertion in unselectAllNodes function
This commit is contained in:
parent
f84df04f8a
commit
21827a29ef
4 changed files with 4 additions and 4 deletions
|
|
@ -56,7 +56,7 @@ export default function CodeTabsComponent({
|
|||
}, [flow]);
|
||||
|
||||
useEffect(() => {
|
||||
if (tweaks) {
|
||||
if (tweaks && data) {
|
||||
unselectAllNodes({
|
||||
data,
|
||||
updateNodes: (nodes) => {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ export default function CodeAreaModal({
|
|||
const { dark } = useContext(darkContext);
|
||||
const { reactFlowInstance } = useContext(typesContext);
|
||||
const [height, setHeight] = useState<string | null>(null);
|
||||
const { setErrorData, setSuccessData, isTweakPage } =
|
||||
const { setErrorData, setSuccessData } =
|
||||
useContext(alertContext);
|
||||
const [error, setError] = useState<{
|
||||
detail: { error: string | undefined; traceback: string | undefined };
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ export type cleanEdgesType = {
|
|||
|
||||
export type unselectAllNodesType = {
|
||||
updateNodes: (nodes: Node[]) => void;
|
||||
data: Node[] | null;
|
||||
data: Node[];
|
||||
};
|
||||
|
||||
export type updateEdgesHandleIdsType = {
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ export function cleanEdges({
|
|||
|
||||
export function unselectAllNodes({ updateNodes, data }: unselectAllNodesType) {
|
||||
let newNodes = _.cloneDeep(data);
|
||||
newNodes!.forEach((node: Node) => {
|
||||
newNodes.forEach((node: Node) => {
|
||||
node.selected = false;
|
||||
});
|
||||
updateNodes(newNodes!);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue