Skip to content

Commit

Permalink
Merge pull request #1648 from ardriveapp/fix-turbo-uploads
Browse files Browse the repository at this point in the history
fix uploads to turbo
  • Loading branch information
thiagocarvalhodev authored Mar 1, 2024
2 parents c518c90 + 7321ae6 commit 8a30769
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 3 deletions.
5 changes: 4 additions & 1 deletion packages/ardrive_uploader/lib/src/data_bundler.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ abstract class DataBundler<T> {
required ARFSUploadMetadata metadata,
required Wallet wallet,
SecretKey? driveKey,
List<DataItemFile>? dataItemFiles,
Function? onStartMetadataCreation,
Function? onFinishMetadataCreation,
Function? onStartBundleCreation,
Expand Down Expand Up @@ -69,6 +70,7 @@ class DataTransactionBundler implements DataBundler<TransactionResult> {
required IOFile file,
required ARFSUploadMetadata metadata,
required Wallet wallet,
List<DataItemFile>? dataItemFiles,
SecretKey? driveKey,
Function? onStartEncryption,
Function? onStartBundling,
Expand All @@ -77,7 +79,7 @@ class DataTransactionBundler implements DataBundler<TransactionResult> {
Function? onStartBundleCreation,
Function? onFinishBundleCreation,
}) async {
final dataItemFiles = await createDataItemsForFile(
dataItemFiles ??= await createDataItemsForFile(
file: file,
metadata: metadata,
wallet: wallet,
Expand Down Expand Up @@ -336,6 +338,7 @@ class BDIDataBundler implements DataBundler<DataItemResult> {
required Wallet wallet,
SecretKey? driveKey,
Function? onStartBundling,
List<DataItemFile>? dataItemFiles,
Function? onStartMetadataCreation,
Function? onFinishMetadataCreation,
Function? onStartBundleCreation,
Expand Down
1 change: 1 addition & 0 deletions packages/ardrive_uploader/lib/src/upload_strategy.dart
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ class UploadFileUsingBundleStrategy extends UploadFileStrategy {
}) async {
final bundle = await _dataBundler.createDataBundle(
file: task.file,
dataItemFiles: dataItems,
metadata: task.metadata,
wallet: wallet,
driveKey: task.encryptionKey,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Future<List<DataItemResult>> createDataItemResultFromDataItemFiles(
Wallet wallet,
) async {
final List<DataItemResult> dataItemList = [];
final dataItemCount = dataItemList.length;
final dataItemCount = dataItems.length;
for (var i = 0; i < dataItemCount; i++) {
final dataItem = dataItems[i];
await createDataItemTaskEither(
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ description: Secure, permanent storage

publish_to: 'none'

version: 2.37.0
version: 2.37.1

environment:
sdk: '>=3.0.2 <4.0.0'
Expand Down

0 comments on commit 8a30769

Please sign in to comment.