From 4cb836def1bb68e6525edea7b7b0d456fdefcadf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Walter?= Date: Mon, 23 Oct 2023 21:37:33 +0200 Subject: [PATCH] Don't try to build parent if cell is ERROR --- .../src/components/ComputedCell/ComputedCell.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/starksheet-webapp/src/components/ComputedCell/ComputedCell.tsx b/packages/starksheet-webapp/src/components/ComputedCell/ComputedCell.tsx index d6a15c5..1532394 100644 --- a/packages/starksheet-webapp/src/components/ComputedCell/ComputedCell.tsx +++ b/packages/starksheet-webapp/src/components/ComputedCell/ComputedCell.tsx @@ -36,10 +36,14 @@ function ComputedCell({ cell }: ComputedCellProps) { const id = useMemo(() => cell.id, [cell]); const [cellSettings, setCellSettings] = useLocalStorage( `${selectedSheetAddress}.${id}`, - {} + {}, ); const selected = useMemo(() => id === selectedCell, [selectedCell, id]); const isInvoke = useMemo(() => { + if (cell.error) { + return false; + } + if ( !!cell.abi && ((Object.hasOwn(cell.abi, "state_mutability") && @@ -59,7 +63,7 @@ function ComputedCell({ cell }: ComputedCellProps) { ((Object.hasOwn(_cell.abi, "state_mutability") && _cell.abi?.state_mutability === "external") || (!Object.hasOwn(_cell.abi, "state_mutability") && - _cell.abi.stateMutability === undefined)) + _cell.abi.stateMutability === undefined)), ); }, [cell, currentCells, id, buildParents]);