fixing empty screen issue when opening edit schema for proto type (#1411)
* fixing empty screen issue when opening edit schema for proto type * making requested changes
This commit is contained in:
parent
1231ee6314
commit
7e3c66b197
1 changed files with 5 additions and 4 deletions
|
@ -37,10 +37,11 @@ const Edit: React.FC = () => {
|
|||
|
||||
const schema = useAppSelector((state) => selectSchemaById(state, subject));
|
||||
|
||||
const formatedSchema = React.useMemo(
|
||||
() => JSON.stringify(JSON.parse(schema?.schema || '{}'), null, '\t'),
|
||||
[schema]
|
||||
);
|
||||
const formatedSchema = React.useMemo(() => {
|
||||
return schema?.schemaType === SchemaType.PROTOBUF
|
||||
? schema?.schema
|
||||
: JSON.stringify(JSON.parse(schema?.schema || '{}'), null, '\t');
|
||||
}, [schema]);
|
||||
|
||||
const onSubmit = React.useCallback(async (props: NewSchemaSubjectRaw) => {
|
||||
if (!schema) return;
|
||||
|
|
Loading…
Add table
Reference in a new issue