From 4f87c68e8275e52f0af21356cb040ad6a664c409 Mon Sep 17 00:00:00 2001 From: hobbes7878 Date: Thu, 28 Nov 2024 14:11:00 +0000 Subject: [PATCH] duh, don't include query string params in referral check --- src/components/ReferralBlock/filterCurrentPage.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/ReferralBlock/filterCurrentPage.ts b/src/components/ReferralBlock/filterCurrentPage.ts index 03de0e24..25365555 100644 --- a/src/components/ReferralBlock/filterCurrentPage.ts +++ b/src/components/ReferralBlock/filterCurrentPage.ts @@ -20,7 +20,10 @@ const isCurrentPage = (urlPath: string) => { } const url = getUrlFromPath(urlPath); if (!url) return false; - return window.location.href === url.href; + return ( + window.location.origin === url.origin && + window.location.pathname === url.pathname + ); }; export const articleIsNotCurrentPage = (article: Article) => {