|
2 | 2 | import { createContext, useContext, type Node } from 'react';
|
3 | 3 | import { useQueries } from 'react-query';
|
4 | 4 | import { useShellConfig } from './ShellConfigProvider';
|
5 |
| -import { useHistory } from 'react-router-dom'; |
6 | 5 | import { useDeployedApps, useDeployedAppsRetriever } from './UIListProvider';
|
7 |
| -import Loader from '@scality/core-ui/dist/components/loader/Loader.component'; |
8 |
| -import ErrorPage500 from '@scality/core-ui/dist/components/error-pages/ErrorPage500.component'; |
| 6 | +import { Loader } from '@scality/core-ui/dist/components/loader/Loader.component'; |
| 7 | +import { ErrorPage500 } from '@scality/core-ui/dist/components/error-pages/ErrorPage500.component'; |
9 | 8 | import { useShellHistory } from './ShellHistoryProvider';
|
10 | 9 |
|
11 | 10 | if (!window.shellContexts) {
|
12 |
| - window.shellContexts = {}; |
| 11 | + window.shellContexts = {}; |
13 | 12 | }
|
14 | 13 |
|
15 | 14 | if (!window.shellContexts.WebFingersContext) {
|
16 |
| - window.shellContexts.WebFingersContext = createContext(null); |
| 15 | + window.shellContexts.WebFingersContext = createContext(null); |
17 | 16 | }
|
18 | 17 |
|
19 | 18 | export type OAuth2ProxyConfig = {
|
@@ -89,7 +88,9 @@ export function useConfigRetriever(): {
|
89 | 88 | | null,
|
90 | 89 | } {
|
91 | 90 | const { retrieveDeployedApps } = useDeployedAppsRetriever();
|
92 |
| - const webFingerContextValue = useContext(window.shellContexts.WebFingersContext); |
| 91 | + const webFingerContextValue = useContext( |
| 92 | + window.shellContexts.WebFingersContext, |
| 93 | + ); |
93 | 94 | if (!webFingerContextValue) {
|
94 | 95 | throw new Error(
|
95 | 96 | "Can't use useConfigRetriever outside of ConfigurationProvider",
|
@@ -143,7 +144,9 @@ export function useConfig({
|
143 | 144 | name: string,
|
144 | 145 | }): RuntimeWebFinger | BuildtimeWebFinger | null {
|
145 | 146 | const { retrieveConfiguration } = useConfigRetriever();
|
146 |
| - const webFingerContextValue = useContext(window.shellContexts.WebFingersContext); |
| 147 | + const webFingerContextValue = useContext( |
| 148 | + window.shellContexts.WebFingersContext, |
| 149 | + ); |
147 | 150 | if (!webFingerContextValue) {
|
148 | 151 | throw new Error("Can't use useConfig outside of ConfigurationProvider");
|
149 | 152 | }
|
|
0 commit comments