From 677359ad80fde0860ad8e91fbdfcae88691afddb Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Fri, 18 Oct 2024 11:57:00 +0200 Subject: [PATCH] increase performance --- src/routes/stocks/[tickerID]/insider/+page.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/routes/stocks/[tickerID]/insider/+page.svelte b/src/routes/stocks/[tickerID]/insider/+page.svelte index 7d21985c..56d4eb8b 100644 --- a/src/routes/stocks/[tickerID]/insider/+page.svelte +++ b/src/routes/stocks/[tickerID]/insider/+page.svelte @@ -188,7 +188,7 @@ // Reset to original data when 'none' and stop further sorting if (sortOrder === "none") { - insiderTradingList = [...originalData]; // Reset to original data (spread to avoid mutation) + insiderTradingList = [...originalData]?.slice(0,50); // Reset to original data (spread to avoid mutation) return; } @@ -223,7 +223,7 @@ }; // Sort using the generic comparison function - insiderTradingList = [...originalData].sort(compareValues); + insiderTradingList = [...originalData].sort(compareValues)?.slice(0,50); }; $: {