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 schema = useAppSelector((state) => selectSchemaById(state, subject));
|
||||||
|
|
||||||
const formatedSchema = React.useMemo(
|
const formatedSchema = React.useMemo(() => {
|
||||||
() => JSON.stringify(JSON.parse(schema?.schema || '{}'), null, '\t'),
|
return schema?.schemaType === SchemaType.PROTOBUF
|
||||||
[schema]
|
? schema?.schema
|
||||||
);
|
: JSON.stringify(JSON.parse(schema?.schema || '{}'), null, '\t');
|
||||||
|
}, [schema]);
|
||||||
|
|
||||||
const onSubmit = React.useCallback(async (props: NewSchemaSubjectRaw) => {
|
const onSubmit = React.useCallback(async (props: NewSchemaSubjectRaw) => {
|
||||||
if (!schema) return;
|
if (!schema) return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue