Skip to content

Commit

Permalink
rename context
Browse files Browse the repository at this point in the history
  • Loading branch information
darnautov committed Oct 11, 2024
1 parent 90fdf82 commit 31ac253
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions x-pack/plugins/ml/public/application/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ import type { MlSetupDependencies, MlStartDependencies } from '../plugin';
import { setLicenseCache } from './license';
import { MlRouter } from './routing';
import type { PageDependencies } from './routing/router';
import { EnabledFeaturesContextProvider, MlServerContextProvider } from './contexts/ml';
import { EnabledFeaturesContextProvider, MlServerInfoContextProvider } from './contexts/ml';
import type { StartServices } from './contexts/kibana';
import { getMlGlobalServices } from './util/get_services';

Expand Down Expand Up @@ -144,9 +144,9 @@ const App: FC<AppProps> = ({
showMLNavMenu={chromeStyle === 'classic'}
experimentalFeatures={experimentalFeatures}
>
<MlServerContextProvider nlpSettings={nlpSettings}>
<MlServerInfoContextProvider nlpSettings={nlpSettings}>
<MlRouter pageDeps={pageDeps} />
</MlServerContextProvider>
</MlServerInfoContextProvider>
</EnabledFeaturesContextProvider>
</DatePickerContextProvider>
</StorageContextProvider>
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/ml/public/application/contexts/ml/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

export { DataSourceContextProvider, useDataSource } from './data_source_context';
export { EnabledFeaturesContextProvider, useEnabledFeatures } from './serverless_context';
export { MlServerContextProvider, useMlServerInfo } from './ml_server_info_context';
export { MlServerInfoContextProvider, useMlServerInfo } from './ml_server_info_context';
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface MlServerInfoContextValue {

export const MlServerInfoContext = createContext<MlServerInfoContextValue | undefined>(undefined);

export const MlServerContextProvider: FC<PropsWithChildren<MlServerInfoContextValue>> = ({
export const MlServerInfoContextProvider: FC<PropsWithChildren<MlServerInfoContextValue>> = ({
children,
nlpSettings,
}) => {
Expand All @@ -33,7 +33,7 @@ export const MlServerContextProvider: FC<PropsWithChildren<MlServerInfoContextVa
export function useMlServerInfo() {
const context = useContext(MlServerInfoContext);
if (context === undefined) {
throw new Error('useMlServerInfo must be used within a MlServerContextProvider');
throw new Error('useMlServerInfo must be used within a MlServerInfoContextProvider');
}
return context;
}

0 comments on commit 31ac253

Please sign in to comment.