Skip to content

Commit

Permalink
Update arweave_service.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagocarvalhodev committed Dec 12, 2024
1 parent bdc4a9c commit 1252767
Showing 1 changed file with 12 additions and 13 deletions.
25 changes: 12 additions & 13 deletions lib/services/arweave/arweave_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -444,23 +444,22 @@ class ArweaveService {
required String driveId,
required bool isPrivate,
}) async {
try {
final txId = entityId;
final txId = entityId;

final cachedData = await _getCachedEntityDataFromSnapshot(
driveId: driveId,
txId: txId,
isPrivate: isPrivate,
);
final cachedData = await _getCachedEntityDataFromSnapshot(
driveId: driveId,
txId: txId,
isPrivate: isPrivate,
);

if (cachedData != null) {
return cachedData;
}
if (cachedData != null) {
return cachedData;
}

return getEntityDataFromNetwork(txId: txId);
} catch (e) {
return getEntityDataFromNetwork(txId: txId).catchError((e) {
logger.e('Failed to get entity data from network', e);
return Uint8List(0);
}
});
}

Future<Uint8List?> _getCachedEntityDataFromSnapshot({
Expand Down

0 comments on commit 1252767

Please sign in to comment.