Skip to content

Commit

Permalink
devop: add code rabbit suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
gamalielhere committed Nov 20, 2024
1 parent fd6b474 commit a030dc6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -134,18 +134,23 @@ const customTokens = ref<CustomErc20Token[]>([]);
const tokenState = new TokensState();
const fetchCustomTokens = async () => {
return await tokenState.getTokensByNetwork(props.network.name).then(res => {
customTokens.value = res.filter(
(token): token is CustomErc20Token => 'address' in token,
);
});
try {
return await tokenState.getTokensByNetwork(props.network.name).then(res => {
customTokens.value = res.filter(
(token): token is CustomErc20Token => 'address' in token,
);
});
} catch {
customTokens.value = [];
}
};
onMounted(async () => {
await fetchCustomTokens();
});
const isCustomToken = computed(() => {
if (!props.token.contract) return false;
return customTokens.value.some(
token =>
token.address.toLowerCase() === props.token.contract?.toLowerCase(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,11 +147,9 @@ const addCustomAsset = (asset: AssetsType) => {
});
if (!existingAsset) {
assets.value = [...assets.value, asset];
// refetches assets to update the custom token
updateAssets();
}
// refetches assets to update the custom token
updateAssets();
};
</script>

Expand Down

0 comments on commit a030dc6

Please sign in to comment.