Skip to content

Commit

Permalink
[SOV-4525] - Display LP Fee Rate Without Wallet Connection (#1039)
Browse files Browse the repository at this point in the history
* SOV-4445: Runes page Updates (#1028)

* chore: update rune symbols

* Create neat-humans-develop.md

* chore: update styles for dog

* SOV-4496: add LST pools (#1029)

* chore: SOV-4496 add new pools

* chore: add background to asset

* Version Packages (#1030)

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>

* Fix asset icon styles (#1032)

* chore: fix asset icon styles

* Create gentle-schools-fetch.md

* [SOV-4525] - Display LP Fee Rate Without Wallet Connection

* Create lucky-students-itch.md

---------

Co-authored-by: Victor Creed <[email protected]>
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
4 people authored Nov 12, 2024
1 parent 9c0946f commit 29852f4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
5 changes: 5 additions & 0 deletions .changeset/lucky-students-itch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"frontend": patch
---

[SOV-4525] - Display LP Fee Rate Without Wallet Connection
8 changes: 3 additions & 5 deletions apps/frontend/src/contexts/CrocContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import React, {
import { getProvider } from '@sovryn/ethers-provider';
import { CrocEnv } from '@sovryn/sdex';

import { useAccount } from '../hooks/useAccount';
import { useCurrentChain } from '../hooks/useChainStore';

type CrocContextValue = {
Expand All @@ -27,14 +26,13 @@ export const useCrocContext = () => useContext(CrocContext) as CrocContextValue;

export const CrocContextProvider: FC<PropsWithChildren> = ({ children }) => {
const chainId = useCurrentChain();
const { account, signer } = useAccount();
const [croc, setCroc] = useState(defaultContextValue.croc);

useEffect(() => {
if (!croc && account) {
setCroc(new CrocEnv(getProvider(chainId), signer));
if (!croc) {
setCroc(new CrocEnv(getProvider(chainId)));
}
}, [croc, account, signer, chainId]);
}, [croc, chainId]);

return (
<CrocContext.Provider value={{ croc }}>{children}</CrocContext.Provider>
Expand Down

0 comments on commit 29852f4

Please sign in to comment.