Use the correct `getAdminSetting` call for fetching `siteUrl` (#52376)
* Use the correct `getAdminSetting` call for fetching `siteUrl` * Lint
This commit is contained in:
parent
262631e344
commit
f0beaa9885
|
@ -0,0 +1,4 @@
|
||||||
|
Significance: patch
|
||||||
|
Type: fix
|
||||||
|
|
||||||
|
Correctly fetch `siteUrl` to fix broken `Back to Store` button
|
|
@ -4,6 +4,11 @@
|
||||||
import { addQueryArgs } from '@wordpress/url';
|
import { addQueryArgs } from '@wordpress/url';
|
||||||
import { getSetting } from '@woocommerce/settings';
|
import { getSetting } from '@woocommerce/settings';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Internal dependencies
|
||||||
|
*/
|
||||||
|
import { getAdminSetting } from '~/utils/admin-settings';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns an in-app-purchase URL.
|
* Returns an in-app-purchase URL.
|
||||||
*
|
*
|
||||||
|
@ -15,7 +20,7 @@ export const getInAppPurchaseUrl = ( url, queryArgs = {} ) => {
|
||||||
const { pathname, search } = window.location;
|
const { pathname, search } = window.location;
|
||||||
const connectNonce = getSetting( 'connectNonce', '' );
|
const connectNonce = getSetting( 'connectNonce', '' );
|
||||||
queryArgs = {
|
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.
|
// If the site is installed in a directory the directory must be included in the back param path.
|
||||||
'wccom-back': pathname + search,
|
'wccom-back': pathname + search,
|
||||||
'wccom-woo-version': getSetting( 'wcVersion' ),
|
'wccom-woo-version': getSetting( 'wcVersion' ),
|
||||||
|
|
Loading…
Reference in New Issue