From 216616960841cbf6cba27cc36f14b1a851038107 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Sat, 17 Sep 2022 19:56:20 -0500 Subject: [PATCH] Fix bug --- web/hooks/use-prob-changes.tsx | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/web/hooks/use-prob-changes.tsx b/web/hooks/use-prob-changes.tsx index 698111b8..a6f89a2a 100644 --- a/web/hooks/use-prob-changes.tsx +++ b/web/hooks/use-prob-changes.tsx @@ -30,8 +30,12 @@ export const useProbChangesAlgolia = (userId: string) => { } return { - positiveChanges: positiveData.hits, - negativeChanges: negativeData.hits, + positiveChanges: positiveData.hits.filter( + (c) => c && c.probChanges.day > 0 + ), + negativeChanges: negativeData.hits.filter( + (c) => c && c.probChanges.day < 0 + ), } }