Skip to content

Commit

Permalink
Merged in bugfix/SHIBUI-2502 (pull request #637)
Browse files Browse the repository at this point in the history
Fixed issue when changing filter types

Approved-by: Doug Sonaty
  • Loading branch information
rmathis committed Feb 16, 2023
2 parents 3c21843 + 940d3cf commit 969c732
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions ui/src/app/metadata/hoc/MetadataSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function MetadataSchema({ type, children, wizard = false }) {

const [schema, setSchema] = React.useState();

async function loadSchema(type) {
const loadSchema = React.useCallback(async (type) => {
const definition = wizard ? getWizard(type) : getDefinition(type);
setDefinition(definition);
setKind(type);
Expand All @@ -34,11 +34,12 @@ export function MetadataSchema({ type, children, wizard = false }) {
setSchema(source);
}
setLoading(false);
}
}, [response.ok, get, wizard]);

React.useState(() => {
React.useEffect(() => {
loadSchema(type);
}, [type]);
setSchema(null);
}, [type, loadSchema]);

return (
<MetadataDefinitionContext.Provider value={definition}>
Expand Down

0 comments on commit 969c732

Please sign in to comment.