mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
Fixing 'View on Opensea' link for main and testnet NFTs (#19797)
This commit is contained in:
parent
d0e7bfddfc
commit
9323701f9b
@ -112,12 +112,13 @@ export default function NftDetails({ nft }) {
|
|||||||
const getOpenSeaLink = () => {
|
const getOpenSeaLink = () => {
|
||||||
switch (currentNetwork) {
|
switch (currentNetwork) {
|
||||||
case CHAIN_IDS.MAINNET:
|
case CHAIN_IDS.MAINNET:
|
||||||
return `https://opensea.io/assets/${address}/${tokenId}`;
|
return `https://opensea.io/assets/ethereum/${address}/${tokenId}`;
|
||||||
case CHAIN_IDS.POLYGON:
|
case CHAIN_IDS.POLYGON:
|
||||||
return `https://opensea.io/assets/matic/${address}/${tokenId}`;
|
return `https://opensea.io/assets/matic/${address}/${tokenId}`;
|
||||||
case CHAIN_IDS.GOERLI:
|
case CHAIN_IDS.GOERLI:
|
||||||
|
return `https://testnets.opensea.io/assets/goerli/${address}/${tokenId}`;
|
||||||
case CHAIN_IDS.SEPOLIA:
|
case CHAIN_IDS.SEPOLIA:
|
||||||
return `https://testnets.opensea.io/assets/${address}/${tokenId}`;
|
return `https://testnets.opensea.io/assets/sepolia/${address}/${tokenId}`;
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -165,7 +165,7 @@ describe('NFT Details', () => {
|
|||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(global.platform.openTab).toHaveBeenCalledWith({
|
expect(global.platform.openTab).toHaveBeenCalledWith({
|
||||||
url: `https://testnets.opensea.io/assets/${nfts[5].address}/${nfts[5].tokenId}`,
|
url: `https://testnets.opensea.io/assets/goerli/${nfts[5].address}/${nfts[5].tokenId}`,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -200,7 +200,7 @@ describe('NFT Details', () => {
|
|||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(global.platform.openTab).toHaveBeenCalledWith({
|
expect(global.platform.openTab).toHaveBeenCalledWith({
|
||||||
url: `https://opensea.io/assets/${nfts[5].address}/${nfts[5].tokenId}`,
|
url: `https://opensea.io/assets/ethereum/${nfts[5].address}/${nfts[5].tokenId}`,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
@ -272,7 +272,7 @@ describe('NFT Details', () => {
|
|||||||
|
|
||||||
await waitFor(() => {
|
await waitFor(() => {
|
||||||
expect(global.platform.openTab).toHaveBeenCalledWith({
|
expect(global.platform.openTab).toHaveBeenCalledWith({
|
||||||
url: `https://testnets.opensea.io/assets/${nfts[5].address}/${nfts[5].tokenId}`,
|
url: `https://testnets.opensea.io/assets/sepolia/${nfts[5].address}/${nfts[5].tokenId}`,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user