Skip to content

Commit

Permalink
[NO CHANGELOG][Add Funds Widget] Fix/add funds prefill token address (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
mimi-imtbl authored Aug 30, 2024
1 parent ab07b84 commit 55af3be
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ export function AddFunds({

useEffect(() => {
if (!checkout) return;

const fetchTokens = async () => {
const tokenResponse = await checkout.getTokenAllowList({
type: TokenFilterTypes.SWAP,
Expand All @@ -74,7 +75,7 @@ export function AddFunds({
setAllowedTokens(tokenResponse.tokens);

if (tokenAddress) {
const token = allowedTokens.find((t) => t.address === tokenAddress);
const token = tokenResponse.tokens.find((t) => t.address === tokenAddress);
setToTokenAddress(token);
} else {
setToTokenAddress(tokenResponse.tokens[0]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function AddFundsUI() {
useEffect(() => {
addFunds.mount(ADD_FUNDS_TARGET_ID, {
showSwapOption: false,
tokenAddress: "0x3b2d8a1931736fc321c24864bceee981b11c3c57",
});
addFunds.addListener(AddFundsEventType.GO_BACK, (data: any) => {
console.log("GO_BACK", data);
Expand Down

0 comments on commit 55af3be

Please sign in to comment.