Skip to content

Commit

Permalink
fix(ui): showing protobuf schema in versions tab crash (#1189)
Browse files Browse the repository at this point in the history
Fixes #1188
  • Loading branch information
ali-1995 authored Aug 30, 2022
1 parent 0e630c1 commit 3079b22
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ class SchemaVersions extends Root {
return {
id: schema.id,
version: schema.version,
schema: JSON.stringify(JSON.parse(schema.schema), null, 2)
schemaType: schema.schemaType,
schema: "PROTOBUF" === schema.schemaType ? schema.schema : JSON.stringify(JSON.parse(schema.schema), null, 2)
};
});
this.setState({ data, loading: false });
Expand Down Expand Up @@ -144,7 +145,7 @@ class SchemaVersions extends Root {
return (
<pre className="mb-0 khq-data-highlight">
<code>
{JSON.stringify(JSON.parse(obj[col.accessor]))}
{obj["schemaType"] === "PROTOBUF" ? obj[col.accessor] : JSON.stringify(JSON.parse(obj[col.accessor]))}
</code>
</pre>
);
Expand Down

0 comments on commit 3079b22

Please sign in to comment.