From 55e415c0c75fa6491ef1776d6f9f74c0c88047cd Mon Sep 17 00:00:00 2001 From: Cathy Sarisky <42299862+cathysarisky@users.noreply.github.com> Date: Tue, 8 Oct 2024 08:38:53 -0400 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BFixed=20404=20error=20for=20Tips=20?= =?UTF-8?q?&=20Donations=20on=20subdirectory=20sites=20(#21250)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #21123 - There was an error in the calculation of the site's url for sites setup as subdirectories (yoursite/blog instead of just yoursite/). - Fixed and tested with a manual build of portal. There's apparently a gap in test coverage here, as it passed both before and after... --- apps/portal/src/components/pages/SupportPage.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/portal/src/components/pages/SupportPage.js b/apps/portal/src/components/pages/SupportPage.js index dfd426c996..2ee7e48239 100644 --- a/apps/portal/src/components/pages/SupportPage.js +++ b/apps/portal/src/components/pages/SupportPage.js @@ -8,12 +8,12 @@ const SupportPage = () => { const [isLoading, setLoading] = useState(true); const [error, setError] = useState(null); const [disabledFeatureError, setDisabledFeatureError] = useState(null); - const {member, t} = useContext(AppContext); + const {member, t, site} = useContext(AppContext); useEffect(() => { async function checkoutDonation() { - const siteUrl = window.location.origin; - const currentUrl = siteUrl + window.location.pathname; + const siteUrl = site.url; + const currentUrl = window.location.origin + window.location.pathname; const successUrl = member ? `${currentUrl}?action=support&success=true` : `${currentUrl}#/portal/support/success`; const cancelUrl = currentUrl; const api = setupGhostApi({siteUrl});