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:
parent
747632bf45
commit
55e415c0c7
1 changed files with 3 additions and 3 deletions
|
@ -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});
|
||||
|
|
Loading…
Reference in a new issue