From bdc4a9cce51520df44a4c5954883ae4bd23b85d9 Mon Sep 17 00:00:00 2001 From: Thiago Carvalho <32248947+thiagocarvalhodev@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:08:17 -0300 Subject: [PATCH] Update arweave_service.dart --- lib/services/arweave/arweave_service.dart | 24 +++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/lib/services/arweave/arweave_service.dart b/lib/services/arweave/arweave_service.dart index 5802f3f9e..c27307447 100644 --- a/lib/services/arweave/arweave_service.dart +++ b/lib/services/arweave/arweave_service.dart @@ -444,19 +444,23 @@ class ArweaveService { required String driveId, required bool isPrivate, }) async { - final txId = entityId; + try { + 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); + return getEntityDataFromNetwork(txId: txId); + } catch (e) { + return Uint8List(0); + } } Future _getCachedEntityDataFromSnapshot({