Skip to content

Commit

Permalink
fix: api url search param
Browse files Browse the repository at this point in the history
  • Loading branch information
He1DAr committed Dec 27, 2023
1 parent 391a262 commit d71b374
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions src/common/api/useApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { useGlobalContext } from '../context/useAppContext';
import { apiClients, createConfig } from './client';

export const useApi = () => {
const apiConfig = createConfig(useGlobalContext().activeNetwork.url);
const basePath = useGlobalContext().activeNetworkKey;
const apiConfig = createConfig(basePath);
const tokenMetadataApiConfig = new TokenMetadataApiConfiguration({
basePath: useGlobalContext().activeNetwork.url,
basePath,
});
return apiClients(apiConfig, tokenMetadataApiConfig);
};
4 changes: 1 addition & 3 deletions src/common/context/useAppContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@ import { useContext } from 'react';
import { GlobalContext } from './GlobalContext';

export const useGlobalContext = () => {
const globalContextProps = useContext(GlobalContext);

return globalContextProps;
return useContext(GlobalContext);
};

1 comment on commit d71b374

@vercel
Copy link

@vercel vercel bot commented on d71b374 Dec 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.