File tree Expand file tree Collapse file tree 1 file changed +15
-7
lines changed
packages/thirdweb/src/extensions/erc721/lazyMinting/read Expand file tree Collapse file tree 1 file changed +15
-7
lines changed Original file line number Diff line number Diff line change @@ -82,10 +82,12 @@ export async function getBatchesToReveal(
8282 tokenId : BigInt ( i ) ,
8383 tokenUri : uri ,
8484 client : options . contract . client ,
85- } ) ;
85+ } ) . catch ( ( ) => undefined ) ;
8686 } ) ,
8787 ) ;
8888
89+ console . log ( { tokenMetadatas } ) ;
90+
8991 const encryptedUriData = await Promise . all (
9092 Array . from ( [ ...uriIndices ] ) . map ( ( i ) =>
9193 EncryptedData . encryptedData ( {
@@ -111,12 +113,18 @@ export async function getBatchesToReveal(
111113 } ) ;
112114
113115 return tokenMetadatas
114- . map ( ( metadata , i ) => ( {
115- batchId : BigInt ( i ) ,
116- batchUri : encryptedBaseUris [ i ] as Hex ,
117- placeholderMetadata : metadata ,
118- } ) )
119- . filter ( ( _ , index ) => ( encryptedBaseUris [ index ] ?. length || 0 ) > 0 ) ;
116+ . map ( ( metadata , i ) => {
117+ if ( metadata === undefined ) {
118+ return ;
119+ }
120+ return {
121+ batchId : BigInt ( i ) ,
122+ batchUri : encryptedBaseUris [ i ] as Hex ,
123+ placeholderMetadata : metadata ,
124+ } ;
125+ } )
126+ . filter ( ( _ , index ) => ( encryptedBaseUris [ index ] ?. length || 0 ) > 0 )
127+ . filter ( ( item ) => item !== undefined ) ;
120128}
121129
122130/**
You can’t perform that action at this time.
0 commit comments