Skip to content

Commit

Permalink
Fixed issue with configuration loading
Browse files Browse the repository at this point in the history
Former-commit-id: b2ab61a5066a7ce64a94e5619fc93bf4c74a6b3c
  • Loading branch information
rmathis committed Jul 28, 2022
1 parent d002e9a commit 953f1fd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ui/src/app/metadata/hoc/MetadataSchema.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { useTranslator } from '../../i18n/hooks';

export const MetadataSchemaContext = React.createContext();
export const MetadataDefinitionContext = React.createContext();
export const MetadataSchemaLoading = React.createContext();

export function MetadataSchema({ type, children, wizard = false }) {

Expand Down Expand Up @@ -35,22 +36,22 @@ export function MetadataSchema({ type, children, wizard = false }) {
return (
<MetadataDefinitionContext.Provider value={definition}>
{type && definition && schema &&
<MetadataSchemaContext.Provider value={{ schema, loading }}>
{children}
<MetadataSchemaContext.Provider value={ schema }>
<MetadataSchemaLoading.Provider value={ loading }>
{children}
</MetadataSchemaLoading.Provider>
</MetadataSchemaContext.Provider>
}
</MetadataDefinitionContext.Provider>
);
}

export function useMetadataSchemaContext () {
const {schema} = React.useContext(MetadataSchemaContext);
return schema;
return React.useContext(MetadataSchemaContext);
}

export function useMetadataSchemaLoading () {
const {loading} = React.useContext(MetadataSchemaContext);
return loading;
return React.useContext(MetadataSchemaLoading);
}

export function useMetadataDefinitionContext() {
Expand Down

0 comments on commit 953f1fd

Please sign in to comment.