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]);
|
}, [flow]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (tweaks) {
|
if (tweaks && data) {
|
||||||
unselectAllNodes({
|
unselectAllNodes({
|
||||||
data,
|
data,
|
||||||
updateNodes: (nodes) => {
|
updateNodes: (nodes) => {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,7 @@ export default function CodeAreaModal({
|
||||||
const { dark } = useContext(darkContext);
|
const { dark } = useContext(darkContext);
|
||||||
const { reactFlowInstance } = useContext(typesContext);
|
const { reactFlowInstance } = useContext(typesContext);
|
||||||
const [height, setHeight] = useState<string | null>(null);
|
const [height, setHeight] = useState<string | null>(null);
|
||||||
const { setErrorData, setSuccessData, isTweakPage } =
|
const { setErrorData, setSuccessData } =
|
||||||
useContext(alertContext);
|
useContext(alertContext);
|
||||||
const [error, setError] = useState<{
|
const [error, setError] = useState<{
|
||||||
detail: { error: string | undefined; traceback: string | undefined };
|
detail: { error: string | undefined; traceback: string | undefined };
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ export type cleanEdgesType = {
|
||||||
|
|
||||||
export type unselectAllNodesType = {
|
export type unselectAllNodesType = {
|
||||||
updateNodes: (nodes: Node[]) => void;
|
updateNodes: (nodes: Node[]) => void;
|
||||||
data: Node[] | null;
|
data: Node[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type updateEdgesHandleIdsType = {
|
export type updateEdgesHandleIdsType = {
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ export function cleanEdges({
|
||||||
|
|
||||||
export function unselectAllNodes({ updateNodes, data }: unselectAllNodesType) {
|
export function unselectAllNodes({ updateNodes, data }: unselectAllNodesType) {
|
||||||
let newNodes = _.cloneDeep(data);
|
let newNodes = _.cloneDeep(data);
|
||||||
newNodes!.forEach((node: Node) => {
|
newNodes.forEach((node: Node) => {
|
||||||
node.selected = false;
|
node.selected = false;
|
||||||
});
|
});
|
||||||
updateNodes(newNodes!);
|
updateNodes(newNodes!);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue