From 0c4da22d3bdac3d30ff81d9fcc12901e9ddc7c8b Mon Sep 17 00:00:00 2001 From: SoulHarsh007 Date: Wed, 1 May 2024 04:29:09 +0530 Subject: [PATCH] fix: skip toast if no data is available for stats Signed-off-by: SoulHarsh007 --- components/Statistics.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/Statistics.tsx b/components/Statistics.tsx index 33e213c..aa3a5e9 100644 --- a/components/Statistics.tsx +++ b/components/Statistics.tsx @@ -86,6 +86,9 @@ export default function Statistics({ ); useEffect(() => { const querySubscription = query.$.subscribe(packages => { + if (!packages.length) { + return; + } const id = toast.loading('Updating statistics...'); handleStats(packages, computedStats => setStats(computedStats)); toast.update(id, {