Skip to content

Commit

Permalink
fix: token list showing/not showing from token
Browse files Browse the repository at this point in the history
  • Loading branch information
brettkolodny committed Jul 28, 2022
1 parent 2f64575 commit 7309ab8
Showing 1 changed file with 26 additions and 2 deletions.
28 changes: 26 additions & 2 deletions packages/extension/src/ui/action/views/swap/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
:token="toToken"
:select-token="selectTokenTo"
:is-finding-rate="isFindingRate"
:fast-list="featuredTokens"
:fast-list="featuredTokensFiltered"
:total-tokens="
toTokens
? toTokens.length - (featuredTokens?.length ?? 0)
Expand Down Expand Up @@ -203,7 +203,30 @@ const toTokensFiltered = computed(() => {
)
return false;
if (props.network.name === token.symbol) return false;
return true;
});
}
return [];
});
const featuredTokensFiltered = computed(() => {
if (featuredTokens.value) {
return featuredTokens.value.filter((token) => {
const featuredTokenAddress = (token as any).contract
? (token as any).contract.toUpperCase()
: undefined;
const fromTokenAddress = (fromToken.value as any).contract
? (fromToken.value as any).contract.toUpperCase()
: undefined;
if (
fromTokenAddress &&
featuredTokenAddress &&
featuredTokenAddress === fromTokenAddress
)
return false;
return true;
});
Expand Down Expand Up @@ -274,6 +297,7 @@ onMounted(async () => {
props.network
.getAllTokens(props.accountInfo.selectedAccount?.address as string)
.then(async (tokens) => {
console.log(tokens[0]);
const api = await props.network.api();
await api.init();
Expand Down

1 comment on commit 7309ab8

@github-actions
Copy link

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.