0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-01-06 22:40:14 -05:00

🐛Fixed 404 error for Tips & Donations on subdirectory sites (#21250)

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...
This commit is contained in:
Cathy Sarisky 2024-10-08 08:38:53 -04:00 committed by GitHub
parent 747632bf45
commit 55e415c0c7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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});