From 9aa537263a078603f8b80af81ebe0503df6c2f80 Mon Sep 17 00:00:00 2001 From: Michal Date: Fri, 20 Sep 2024 12:30:34 +0100 Subject: [PATCH] Fix era end check --- .../WalletManager/network-manager/helpers/epoch-progress.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/wallet-mobile/src/features/WalletManager/network-manager/helpers/epoch-progress.ts b/apps/wallet-mobile/src/features/WalletManager/network-manager/helpers/epoch-progress.ts index 30a697eea5..3d46e19bcb 100644 --- a/apps/wallet-mobile/src/features/WalletManager/network-manager/helpers/epoch-progress.ts +++ b/apps/wallet-mobile/src/features/WalletManager/network-manager/helpers/epoch-progress.ts @@ -13,7 +13,9 @@ export function epochProgress(epochInfo: Network.EpochInfo) { absoluteSlot += Math.floor((date.getTime() - era.start.getTime()) / 1e3 / era.slotInSeconds) break } - absoluteSlot += Math.floor((era.end.getTime() - era.start.getTime()) / 1e3 / era.slotInSeconds) + absoluteSlot += Math.floor( + ((era.end?.getTime() ?? new Date().getTime()) - era.start.getTime()) / 1e3 / era.slotInSeconds, + ) } if (date > epochEnd || date < epochStart) {