Skip to content

Commit

Permalink
fix reward amount after undeposit from the farm and remove unused gas…
Browse files Browse the repository at this point in the history
…updater
  • Loading branch information
totop716 committed Jun 29, 2023
1 parent 3c1f61a commit 12611ee
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 63 deletions.
2 changes: 0 additions & 2 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ import 'slick-carousel/slick/slick-theme.css';
import './i18n';
import { mainTheme } from './theme';
import Background from 'layouts/Background';
import GasUpdater from 'state/application/gasUpdater';
import { RedirectExternal } from 'components/RedirectExternal/RedirectExternal';
import NotFound404Page from 'pages/NotFound404Page';

Expand Down Expand Up @@ -98,7 +97,6 @@ function Updaters() {
<SyrupUpdater />
<AnalyticsUpdater />
<AdsUpdater />
<GasUpdater />
</>
);
}
Expand Down
27 changes: 0 additions & 27 deletions src/hooks/useGasPrice.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1 @@
import { useState } from 'react';

export const GAS_PRICE_MULTIPLIER = 1_000_000_000;

export function useGasPrice() {
const [gasPrice, setGasPrice] = useState<{
fetched: null | number;
override: boolean;
}>({ fetched: null, override: false });
const [gasPriceLoading, setGasPriceLoading] = useState<boolean>(false);

async function fetchGasPrice() {
setGasPriceLoading(true);

try {
const gasPriceReq = await fetch(
'https://gasstation-mainnet.matic.network/',
);
const { standard } = await gasPriceReq.json();
setGasPrice({ fetched: standard, override: standard < 36 });
} catch (err) {
console.error('Gas price fetching failed', err.code, err.message);
}
setGasPriceLoading(false);
}

return { fetchGasPrice, gasPrice, gasPriceLoading };
}
4 changes: 2 additions & 2 deletions src/hooks/useIncentiveSubgraph.ts
Original file line number Diff line number Diff line change
Expand Up @@ -491,10 +491,10 @@ export function useFarmingSubgraph() {
pool: newPool,
eternalEarned: rewardRes
? formatUnits(rewardRes.reward, _rewardToken.decimals)
: undefined,
: 0,
eternalBonusEarned: rewardRes
? formatUnits(rewardRes.bonusReward, _bonusRewardToken.decimals)
: undefined,
: 0,
};
} else {
const res = await fetch(
Expand Down
32 changes: 0 additions & 32 deletions src/state/application/gasUpdater.ts

This file was deleted.

0 comments on commit 12611ee

Please sign in to comment.