From a2b43206d3e056d3e2aedab387bdd13996d56474 Mon Sep 17 00:00:00 2001 From: alexandermendes Date: Mon, 11 Nov 2024 23:22:16 +0000 Subject: [PATCH] fix: ensure percentage prop is always defined in streams --- src/provider.tsx | 2 +- src/types/stream.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/provider.tsx b/src/provider.tsx index 4cbd417..9724077 100644 --- a/src/provider.tsx +++ b/src/provider.tsx @@ -291,7 +291,7 @@ export const StakingProvider = ({ return { ...stream, apr: aprs.streams[i], - percentage: streamsProgress[i + 1], + percentage: streamsProgress[i + 1] ?? 0, startTimestamp: firstScheduleTime ? firstScheduleTime.toNumber() * 1000 : 0, diff --git a/src/types/stream.ts b/src/types/stream.ts index 273c0ba..271cb2f 100644 --- a/src/types/stream.ts +++ b/src/types/stream.ts @@ -14,7 +14,7 @@ export type Stream = { coingeckoName: CoingeckoToken; decimals: number; id: number; - percentage?: number; + percentage: number; symbol: string; name: string; price?: number;