diff --git a/components/Transaction/json.tsx b/components/Transaction/json.tsx index fed2826..e37a286 100644 --- a/components/Transaction/json.tsx +++ b/components/Transaction/json.tsx @@ -29,11 +29,18 @@ export const TxJson: FC = ({ setState, }) => { const { editorSettings, accounts } = useSnapshot(state); - const { editorValue = getJsonString?.(), estimatedFee } = txState; + const { editorValue, estimatedFee } = txState; const [currTxType, setCurrTxType] = useState( txState.selectedTransaction?.value ); + useEffect(() => { + setState({ + editorValue: getJsonString?.(), + }); + // eslint-disable-next-line react-hooks/exhaustive-deps + }, []); + useEffect(() => { const parsed = parseJSON(editorValue); if (!parsed) return;