From 5d5c42ebc2e7a51f8eaa404a46b1beb6a4c99216 Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sun, 17 Dec 2023 22:15:49 -0800
Subject: fix(activities): fill missing dates

---
 src/lib/Tools/ActivityHistory.svelte | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

(limited to 'src/lib/Tools/ActivityHistory.svelte')

diff --git a/src/lib/Tools/ActivityHistory.svelte b/src/lib/Tools/ActivityHistory.svelte
index c6f29028..17067ec4 100644
--- a/src/lib/Tools/ActivityHistory.svelte
+++ b/src/lib/Tools/ActivityHistory.svelte
@@ -87,10 +87,11 @@
 		{#if activities === undefined}
 			Loading ...
 		{:else}
-			{@const highestActivity = Math.max(...activities.map((activity) => activity.amount))}
+			{@const filledActivities = fillMissingDays(activities)}
+			{@const highestActivity = Math.max(...filledActivities.map((activity) => activity.amount))}
 
 			<div class="grid">
-				{#each activities as activity}
+				{#each filledActivities as activity}
 					<div
 						class="grid-item"
 						style="background-color: {gradientColour(activity.amount, highestActivity, baseHue)}"
@@ -123,7 +124,7 @@
 				</summary>
 
 				<ul>
-					{#each fillMissingDays(activities) as activity}
+					{#each filledActivities as activity}
 						{#if activity.amount === 0}
 							<li>
 								{new Date(
-- 
cgit v1.2.3

