|
@@ -8,16 +8,11 @@ interface IReturnProps {
|
|
|
isLoadingComplete?: boolean;
|
|
|
}
|
|
|
|
|
|
-// const fetcher: BareFetcher<any> = (url: string) => {
|
|
|
-// return axios.get(getUrl(url)).then((res) => res.data);
|
|
|
-// };
|
|
|
-
|
|
|
export default function useCachedResources(): IReturnProps {
|
|
|
const ip = process.env.NEXT_PUBLIC_INTERNAL_IP;
|
|
|
const domain = process.env.NEXT_PUBLIC_DOMAIN;
|
|
|
const port = process.env.NEXT_PUBLIC_PORT;
|
|
|
|
|
|
- // const { data } = useSWR<{ ip: string; domain: string; port: string }>('api/ip', fetcher);
|
|
|
const { baseUrl, setBaseUrl, setInternalIp, setDomain } = useSytemStore();
|
|
|
const [isLoadingComplete, setLoadingComplete] = useState(false);
|
|
|
const [client, setClient] = useState<ApolloClient<unknown>>();
|
|
@@ -50,7 +45,7 @@ export default function useCachedResources(): IReturnProps {
|
|
|
setBaseUrl(`https://${domain}/api`);
|
|
|
}
|
|
|
}
|
|
|
- }, [baseUrl, setBaseUrl, setInternalIp, setDomain]);
|
|
|
+ }, [baseUrl, setBaseUrl, setInternalIp, setDomain, ip, domain, port]);
|
|
|
|
|
|
useEffect(() => {
|
|
|
if (baseUrl) {
|