bridge_ui: add NFT URI length check
This commit is contained in:
parent
94a15d37a9
commit
7f74392a91
|
@ -89,6 +89,18 @@ export const selectNFTSourceError = (state: RootState): string | undefined => {
|
||||||
// TODO: more advanced NFT check - also check supply and uri
|
// TODO: more advanced NFT check - also check supply and uri
|
||||||
return "For non-NFTs, use the Transfer flow";
|
return "For non-NFTs, use the Transfer flow";
|
||||||
}
|
}
|
||||||
|
if (
|
||||||
|
state.nft.sourceParsedTokenAccount?.uri === null ||
|
||||||
|
state.nft.sourceParsedTokenAccount?.uri === undefined
|
||||||
|
) {
|
||||||
|
return "Failed to load NFT Metadata.";
|
||||||
|
}
|
||||||
|
if (
|
||||||
|
state.nft.sourceParsedTokenAccount?.uri &&
|
||||||
|
state.nft.sourceParsedTokenAccount?.uri.length > 200
|
||||||
|
) {
|
||||||
|
return "This NFT has a URL longer than the maximum supported length of 200.";
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
// these may trigger error: fractional component exceeds decimals
|
// these may trigger error: fractional component exceeds decimals
|
||||||
if (
|
if (
|
||||||
|
|
Loading…
Reference in New Issue