Use the correct `getAdminSetting` call for fetching `siteUrl` (#52376)

* Use the correct `getAdminSetting` call for fetching `siteUrl`

* Lint
This commit is contained in:
Boro Sitnikovski 2024-10-29 07:54:18 +01:00 committed by GitHub
parent 262631e344
commit f0beaa9885
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

@ -0,0 +1,4 @@
Significance: patch
Type: fix
Correctly fetch `siteUrl` to fix broken `Back to Store` button

View File

@ -4,6 +4,11 @@
import { addQueryArgs } from '@wordpress/url';
import { getSetting } from '@woocommerce/settings';
/**
* Internal dependencies
*/
import { getAdminSetting } from '~/utils/admin-settings';
/**
* Returns an in-app-purchase URL.
*
@ -15,7 +20,7 @@ export const getInAppPurchaseUrl = ( url, queryArgs = {} ) => {
const { pathname, search } = window.location;
const connectNonce = getSetting( 'connectNonce', '' );
queryArgs = {
'wccom-site': getSetting( 'siteUrl' ),
'wccom-site': getAdminSetting( 'siteUrl' ),
// If the site is installed in a directory the directory must be included in the back param path.
'wccom-back': pathname + search,
'wccom-woo-version': getSetting( 'wcVersion' ),