Skip to content

Commit

Permalink
don't show error alert if there's no error
Browse files Browse the repository at this point in the history
  • Loading branch information
Ben Loe committed Apr 19, 2024
1 parent 0823b7a commit df847a7
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/components/fields/schemaFields/RemoteSchemaObjectField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,16 @@ const ChildObjectWidgetContent: React.FC<
return <Loader />;
}

// If there's an issue loading the schema, show a basic object input so mod developers aren't blocked
if (remoteSchemaState.error || remoteSchemaState.data == null) {
return (
<>
<FieldAnnotationAlert
message={getErrorMessage(remoteSchemaState.error)}
type={AnnotationType.Error}
/>
{/* If there's an issue loading the schema, show a basic object input so mod developers aren't blocked */}
{remoteSchemaState.error && (
<FieldAnnotationAlert
message={getErrorMessage(remoteSchemaState.error)}
type={AnnotationType.Error}
/>
)}
<ObjectWidget name={name} schema={FALLBACK_SCHEMA} />
</>
);
Expand Down

0 comments on commit df847a7

Please sign in to comment.