diff --git a/lib/blocs/upload/upload_cubit.dart b/lib/blocs/upload/upload_cubit.dart index c7a1bc4fc0..f5d4e8af36 100644 --- a/lib/blocs/upload/upload_cubit.dart +++ b/lib/blocs/upload/upload_cubit.dart @@ -460,7 +460,10 @@ class UploadCubit extends Cubit { if (configService.config.useNewUploader) { if (_uploadMethod == UploadMethod.turbo) { await _verifyIfUploadContainsLargeFilesUsingTurbo(); - if (!hasEmittedWarning && kIsWeb && !await AppPlatform.isChrome()) { + if ((_containsLargeTurboUpload ?? false) && + !hasEmittedWarning && + kIsWeb && + !await AppPlatform.isChrome()) { emit( UploadShowingWarning( reason: UploadWarningReason.fileTooLargeOnNonChromeBrowser, diff --git a/packages/ardrive_uploader/lib/src/data_bundler.dart b/packages/ardrive_uploader/lib/src/data_bundler.dart index 32995d7ecf..1e944fcc09 100644 --- a/packages/ardrive_uploader/lib/src/data_bundler.dart +++ b/packages/ardrive_uploader/lib/src/data_bundler.dart @@ -91,7 +91,14 @@ class DataTransactionBundler implements DataBundler { Function? onStartBundleCreation, Function? onFinishBundleCreation, }) async { + SecretKey? key; + if (driveKey != null) { + key = await deriveFileKey( + driveKey, + metadata.id, + keyByteLength, + ); onStartEncryption?.call(); } else { onStartBundling?.call(); @@ -103,7 +110,7 @@ class DataTransactionBundler implements DataBundler { fileLength: await file.length, metadata: metadata, wallet: wallet, - encryptionKey: driveKey, + encryptionKey: key, ); onStartMetadataCreation?.call(); @@ -360,6 +367,15 @@ class BDIDataBundler implements DataBundler { print('Creating bundle for file: ${file.path}'); onStartMetadataCreation?.call(); print('Creating metadata data item'); + SecretKeyData? key; + + if (driveKey != null) { + key = await deriveFileKey( + driveKey, + metadata.id, + keyByteLength, + ); + } // returns the encrypted or not file read stream and the cipherIv if it was encrypted final dataGenerator = await _dataGenerator( @@ -367,7 +383,7 @@ class BDIDataBundler implements DataBundler { fileLength: await file.length, metadata: metadata, wallet: wallet, - encryptionKey: driveKey, + encryptionKey: key, ); final metadataDataItem = await _generateMetadataDataItemForFile( diff --git a/pubspec.lock b/pubspec.lock index 881ec10d96..e2bc964c91 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -2306,5 +2306,5 @@ packages: source: hosted version: "3.1.2" sdks: - dart: ">=3.1.0 <4.0.0" + dart: ">=3.1.3 <4.0.0" flutter: ">=3.13.6"