Skip to content

Commit

Permalink
Update shared_file_download_cubit.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocarvalhodev committed Oct 26, 2023
1 parent ba6b28d commit 0b5a1f5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/blocs/file_download/shared_file_download_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,13 @@ class SharedFileDownloadCubit extends FileDownloadCubit {
),
);

String? cipher;
String? cipherTag;
String? cipherIvTag;
final isPinFile = revision.pinnedDataOwnerAddress != null;

if (revision.dataTxId == null) {
final dataTxId = revision.dataTxId;

if (dataTxId == null) {
logger.e('Data transaction id is null');
throw StateError('Data transaction id is null');
}
Expand All @@ -52,18 +54,18 @@ class SharedFileDownloadCubit extends FileDownloadCubit {
throw StateError('Data transaction not found');
}

cipher = dataTx.getTag(EntityTag.cipher);
cipherTag = dataTx.getTag(EntityTag.cipher);
cipherIvTag = dataTx.getTag(EntityTag.cipherIv);
}

final downloadStream = _arDriveDownloader.downloadFile(
dataTx: revision.dataTxId!,
dataTx: dataTxId,
fileName: revision.name,
fileSize: revision.size,
lastModifiedDate: revision.lastModifiedDate,
contentType:
revision.contentType ?? lookupMimeTypeWithDefaultType(revision.name),
cipher: cipher,
cipher: cipherTag,
cipherIvString: cipherIvTag,
fileKey: fileKey,
isManifest: revision.contentType == ContentType.manifest,
Expand Down

0 comments on commit 0b5a1f5

Please sign in to comment.