Skip to content

Commit

Permalink
Adjust some memos to include dependencies, hide router behind a windo…
Browse files Browse the repository at this point in the history
…w check
  • Loading branch information
af-afk committed Jun 20, 2024
1 parent b6e4c8c commit ea9a1c5
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion web/src/app/stake/pool/confirm-withdraw/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function ConfirmWithdrawLiquidity() {
args: [token0.address, id, delta],
});
},
[writeContractUpdatePosition, token0AmountRaw, token0],
[delta, writeContractUpdatePosition, token0AmountRaw, token0],
);

// price of the current pool
Expand Down
5 changes: 4 additions & 1 deletion web/src/app/stake/pool/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ export default function PoolPage() {
const { data: userData } = useGraphqlUser();
const allPoolsData = useFragment(ManagePoolFragment, globalData?.pools);
const positionsData_ = useFragment(PositionsFragment, userData?.getWallet)
const positionsData = useMemo(() => positionsData_?.positions.positions.filter(p => p.pool.address === id), [positionsData_])
const positionsData = useMemo(() =>
positionsData_?.positions.positions.filter(p => p.pool.address === id),
[id, positionsData_]
);


const {
Expand Down
7 changes: 4 additions & 3 deletions web/src/app/stake/pool/withdraw-liquidity/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,10 @@ export default function WithdrawLiquidity() {
const params = useSearchParams();

const positionId = params.get("positionId")
if (!positionId) {
router.back();
}

useEffect(() => {
if (!positionId && typeof window !== undefined) router.back();
}, [positionId, router]);

const { address } = useAccount()

Expand Down

0 comments on commit ea9a1c5

Please sign in to comment.