Skip to content

Commit

Permalink
devop: remove networks that dont have valid pricing for fiat
Browse files Browse the repository at this point in the history
  • Loading branch information
gamalielhere committed Jul 18, 2024
1 parent f03bff5 commit 6b19b95
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions src/components/OrderForm/components/TokenSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,18 +191,21 @@ export default defineComponent({
let tokensList = [mainCoin];
if (this.fiatName === "CAD") return tokensList;
if (this.networkSelected.tokens.length > 0)
tokensList = tokensList.concat(this.networkSelected.tokens);
return tokensList.concat(this.networkSelected.tokens);
return tokensList;
},
filteredTokenList() {
const filterText = this.searchInput.toLowerCase();
const a = this.tokensList.filter((token) => {
const tokens = this.tokensList.filter((token) => {
const tokenSymbol = token.name.toLowerCase();
const tokenName = token.subtext.toLowerCase();
if (tokenSymbol.includes(filterText) || tokenName.includes(filterText))
if (
this.hasValidPrices(token.symbol) &&
(tokenSymbol.includes(filterText) || tokenName.includes(filterText))
)
return token;
});
return a;
return tokens;
},
fiatName() {
return this.fiatSelected.name;
Expand All @@ -213,10 +216,11 @@ export default defineComponent({
: this.networks;
},
filteredNetworkList() {
const withTokensNetwork = this.networkList.filter(
(network) => network.tokens.length > 0
);
const withTokensNetwork = this.networkList
.filter((network) => network.tokens.length > 0)
.filter((network) => this.hasValidPrices(network.name));
const filter = this.networkSearchInput.toLowerCase();
return withTokensNetwork.filter(
(network) =>
network.name.toLowerCase().includes(filter) ||
Expand Down

0 comments on commit 6b19b95

Please sign in to comment.