fix JSON side drawer field crashing if value is a firestore ref

This commit is contained in:
Sidney Alcantara
2022-11-14 13:01:09 +11:00
parent 42a8443c94
commit 0b75d60813

View File

@@ -40,13 +40,14 @@ export default function Json({
const [editor, setEditor] = useAtom(jsonEditorAtom, projectScope);
const [codeValid, setCodeValid] = useState(true);
const sanitizedValue =
const baseValue =
value !== undefined && isValidJson(value)
? value
: column.config?.isArray
? []
: {};
const formattedJson = stringify(sanitizedValue, { space: 2 });
const formattedJson = stringify(baseValue, { space: 2 });
const sanitizedValue = JSON.parse(formattedJson);
if (disabled)
return (