From 0c95658f7fbfff2c00ef270be81788faf86c6e70 Mon Sep 17 00:00:00 2001 From: MuslemRahimi Date: Wed, 14 Aug 2024 00:24:35 +0200 Subject: [PATCH] bugfixing: redirect correctly stock page in hedge funds --- src/lib/components/BullBearSay.svelte | 2 ++ src/lib/utils.ts | 2 +- src/routes/community/+page.svelte | 6 +++--- src/routes/hedge-funds/[slug]/+page.svelte | 10 +++++----- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/src/lib/components/BullBearSay.svelte b/src/lib/components/BullBearSay.svelte index 80eeebcd..aed43180 100644 --- a/src/lib/components/BullBearSay.svelte +++ b/src/lib/components/BullBearSay.svelte @@ -10,6 +10,8 @@ let showFullText = false; // Function to split text into paragraphs + //DO NOT TOUCH THIS CODE - SAFARI 15.3 are not compatible with the previous code. The website will break. + // CONSIDER MOVING THIS LOGIC TO THE BACKEND TO REMOVE THE RISK COMPLETELY function splitIntoParagraphs(text) { if (!text) return []; diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 47901796..98d5b400 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -143,7 +143,7 @@ export function sumQuarterlyResultsByYear(quarterlyResults, namingList) { // Define a Set of keys to exclude from summing // FMP sucks since these keys are up to date for every quarter hence no summation required - const excludeKeys = new Set(['priceToEarnings', 'weightedAverageShsOut', 'weightedAverageShsOutDil']); + const excludeKeys = new Set(['totalDebt','priceToEarnings', 'weightedAverageShsOut', 'weightedAverageShsOutDil']); // Function to get the quarter number from the period string function getQuarterNumber(period) { diff --git a/src/routes/community/+page.svelte b/src/routes/community/+page.svelte index 6c699948..3d159170 100644 --- a/src/routes/community/+page.svelte +++ b/src/routes/community/+page.svelte @@ -213,7 +213,7 @@ let BottomNavigation; onMount(async () => { if (Object?.keys($cachedPosts)?.length === 0) { // Only make API requests if cached posts are not available - [communityStats, moderators, posts, discordData] = await Promise?.all([ + [communityStats, moderators, posts, discordData] = await Promise.all([ getCommunityStats(), getModerators(), getPost(), @@ -222,7 +222,6 @@ onMount(async () => { ]); window.scrollTo(0, 0); - loading = false; } else { @@ -232,7 +231,6 @@ onMount(async () => { moderators = getCache('', 'getModerators'); discordData = getCache('','getDiscordWidget'); //tickerMentioning = getCache('','getTickerMentioning'); - loading = false; // Mark loading as complete } if(!data?.user) @@ -242,6 +240,8 @@ onMount(async () => { BottomNavigation = (await import('$lib/components/BottomNavigation.svelte')).default; + loading = false; + }); diff --git a/src/routes/hedge-funds/[slug]/+page.svelte b/src/routes/hedge-funds/[slug]/+page.svelte index 6d7abbff..4635169b 100644 --- a/src/routes/hedge-funds/[slug]/+page.svelte +++ b/src/routes/hedge-funds/[slug]/+page.svelte @@ -744,11 +744,11 @@ onMount(async () => { {#each displayList as item} goto(`/${item?.type}/${item?.symbol}`)} class="sm:hover:bg-[#245073] sm:hover:bg-opacity-[0.2] odd:bg-[#27272A] border-b-[#27272A] cursor-pointer"> - +
{item?.symbol?.replace('_',' ')} - {formatString(item?.securityName)} + {formatString(item?.securityName)}
@@ -849,13 +849,13 @@ onMount(async () => { {#each displayList as item,index} - goto(`/${item?.type}/${item?.ticker}`)} class="odd:bg-[#27272A] cursor-pointer"> + goto(`/${item?.type}/${item?.symbol}`)} class="odd:bg-[#27272A] cursor-pointer"> - +
{item?.symbol?.replace('_',' ')} - {item?.securityName?.length > charNumber ? formatString(item?.securityName?.slice(0,charNumber)) + '...' : formatString(item?.securityName)} + {item?.securityName?.length > charNumber ? formatString(item?.securityName?.slice(0,charNumber)) + '...' : formatString(item?.securityName)}