Skip to content

Commit

Permalink
fetching brand name from newfold runtime also
Browse files Browse the repository at this point in the history
  • Loading branch information
abhijitb committed Oct 8, 2024
1 parent dd63f66 commit ba4556b
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '443596ffba72102f3ec7');
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '3970b4d6c65605cc2d65');
34 changes: 17 additions & 17 deletions build/index.js

Large diffs are not rendered by default.

15 changes: 10 additions & 5 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,19 @@ export const OnboardingAPIs = {
export const CapabilityAPI = {
getHelpCenterCapability: () => {
return (
// get the help center capability from newfold runtime
window.NewfoldRuntime?.capabilities?.canAccessHelpCenter || false
);
},
getBrand: () =>
apiFetch( {
path: base + '/capability/brand',
method: 'GET',
} ),
getBrand: () => {
// get the brand name from newfold runtime
const brand = window.NewfoldRuntime?.plugin?.brand || 'wordpress';
// add region if HostGator
if ( brand.includes( 'hostgator' ) ) {
return brand + '-' + window.NewfoldRuntime?.plugin?.region;
}
return brand;
},
};

// A wrapper to get and set things more easily
Expand Down

0 comments on commit ba4556b

Please sign in to comment.