Skip to content

Commit

Permalink
feat(pin file bloc): tag public pinned files only PE-4545
Browse files Browse the repository at this point in the history
  • Loading branch information
matibat committed Sep 18, 2023
1 parent 2d8de92 commit 791649d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions lib/blocs/pin_file/pin_file_bloc.dart
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,8 @@ class PinFileBloc extends Bloc<PinFileEvent, PinFileState> {
.folderById(driveId: _driveId, folderId: _parentFolderId)
.getSingle();

final isAPublicPin = fileKey == null;

if (_turboUploadService.useTurboUpload) {
final fileDataItem = await _arweave.prepareEntityDataItem(
newFileEntity,
Expand All @@ -320,12 +322,11 @@ class PinFileBloc extends Bloc<PinFileEvent, PinFileState> {
skipSignature: true,
);

fileDataItem.addTag(
EntityTag.arFsPin,
'true',
);
if (fileKey == null) {
// If file is public
if (isAPublicPin) {
fileDataItem.addTag(
EntityTag.arFsPin,
'true',
);
fileDataItem.addTag(
EntityTag.pinnedDataTx,
newFileEntity.dataTxId!,
Expand All @@ -347,12 +348,11 @@ class PinFileBloc extends Bloc<PinFileEvent, PinFileState> {
skipSignature: true,
);

fileDataItem.addTag(
EntityTag.arFsPin,
'true',
);
if (fileKey == null) {
// If file is public
if (isAPublicPin) {
fileDataItem.addTag(
EntityTag.arFsPin,
'true',
);
fileDataItem.addTag(
EntityTag.pinnedDataTx,
newFileEntity.dataTxId!,
Expand Down

0 comments on commit 791649d

Please sign in to comment.