Skip to content

Commit

Permalink
Use config network for tokens explore url (#4037)
Browse files Browse the repository at this point in the history
  • Loading branch information
samuveth authored Jul 6, 2023
1 parent 0a7e01c commit 6e909f4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
2 changes: 2 additions & 0 deletions src/plugins/safeSnap/components/Form/TokensModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const props = defineProps<{
open: boolean;
tokenAddress: string;
tokens: TokenAsset[];
network: string;
}>();
const emit = defineEmits(['close', 'tokenAddress']);
Expand Down Expand Up @@ -110,6 +111,7 @@ function handleTokenClick(token) {
:key="token.address"
:token="token"
:is-selected="token.address === tokenAddress"
:network="network"
@select="handleTokenClick"
/>

Expand Down
11 changes: 2 additions & 9 deletions src/plugins/safeSnap/components/Form/TokensModalItem.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import { ETH_CONTRACT } from '@/helpers/constants';
const props = defineProps<{
token: TokenAsset;
isSelected: boolean;
network: string;
}>();
const emit = defineEmits(['select']);
Expand All @@ -14,9 +15,7 @@ const { formatNumber, getNumberFormatter } = useIntl();
const { copyToClipboard } = useCopy();
const exploreUrl = computed(() => {
const network = props.token.verified ? String(props.token.chainId) : null;
if (!network) return null;
return explorerUrl(network, props.token.address);
return explorerUrl(props.network, props.token.address);
});
</script>

Expand Down Expand Up @@ -70,12 +69,6 @@ const exploreUrl = computed(() => {
>
{{ shorten(token.address) }}</BaseLink
>
<span
v-else-if="token.address !== 'main'"
@click.stop="copyToClipboard(token.address)"
>
{{ shorten(token.address) }}
</span>
</div>
</div>
</button>
Expand Down
1 change: 1 addition & 0 deletions src/plugins/safeSnap/components/Form/TransferFunds.vue
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ export default {
:tokens="tokens"
:token-address="tokenAddress"
:open="modalTokensOpen"
:network="config.network"
@token-address="tokenAddress = $event"
@close="modalTokensOpen = false"
/>
Expand Down

1 comment on commit 6e909f4

@vercel
Copy link

@vercel vercel bot commented on 6e909f4 Jul 6, 2023

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.