Skip to content

Commit 9b57877

Browse files
committed
address rabbit comments
1 parent efee6b0 commit 9b57877

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/_common/form.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ export type CreateNFTCollectionFunctions = {
5252
values: CreateNFTCollectionAllValues;
5353
batch: {
5454
startIndex: number;
55-
endIndex: number;
55+
count: number;
5656
};
5757
}) => Promise<void>;
5858
lazyMintNFTs: (values: CreateNFTCollectionAllValues) => Promise<void>;

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/create-nft-page.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -335,21 +335,22 @@ export function CreateNFTPage(props: {
335335
values: CreateNFTCollectionAllValues;
336336
batch: {
337337
startIndex: number;
338-
endIndex: number;
338+
count: number;
339339
};
340340
}) {
341341
const { values, batch } = params;
342342
const { contract, activeAccount } = getContractAndAccount({
343343
chain: values.collectionInfo.chain,
344344
});
345345

346-
const nfts = values.nfts.slice(batch.startIndex, batch.endIndex);
346+
const endIndexExclusive = batch.startIndex + batch.count;
347+
const nfts = values.nfts.slice(batch.startIndex, endIndexExclusive);
347348

348349
// fetch nfts
349350
const fetchedNFTs = await getNFTs1155({
350351
contract,
351352
start: batch.startIndex,
352-
count: batch.endIndex - batch.startIndex,
353+
count: batch.count,
353354
});
354355

355356
const transactions = nfts.map((uploadedNFT, i) => {

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/assets/create/nft/launch/launch-nft.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ export function LaunchNFT(props: {
186186
values: formValues,
187187
batch: {
188188
startIndex: batchIndex * batchSize,
189-
endIndex: (batchIndex + 1) * batchSize,
189+
count: batchSize,
190190
},
191191
});
192192

@@ -197,7 +197,7 @@ export function LaunchNFT(props: {
197197
values: formValues,
198198
batch: {
199199
startIndex: 0,
200-
endIndex: formValues.nfts.length - 1,
200+
count: formValues.nfts.length,
201201
},
202202
});
203203
}
@@ -258,7 +258,11 @@ export function LaunchNFT(props: {
258258
return;
259259
}
260260

261-
await executeSteps(steps, startIndex);
261+
try {
262+
await executeSteps(steps, startIndex);
263+
} catch {
264+
// no op
265+
}
262266
}
263267

264268
const isComplete = steps.every((step) => step.status.type === "completed");

0 commit comments

Comments
 (0)