Skip to content

Commit

Permalink
checking for data in NewfoldRuntime object instead of calling the Hii…
Browse files Browse the repository at this point in the history
…ve api
  • Loading branch information
abhijitb committed Oct 7, 2024
1 parent 77e132e commit c6a41ef
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 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' => '9f695924420aef9082a5');
<?php return array('dependencies' => array('lodash', 'react', 'wp-api-fetch', 'wp-data', 'wp-dom-ready', 'wp-element', 'wp-i18n'), 'version' => '9fef794e59bde79f9068');
34 changes: 17 additions & 17 deletions build/index.js

Large diffs are not rendered by default.

16 changes: 6 additions & 10 deletions src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,12 @@ export const OnboardingAPIs = {
};

export const CapabilityAPI = {
getHelpCenterCapability: () =>
apiFetch( {
path: base + '/capability',
method: 'GET',
} ),
getBrand: () =>
apiFetch( {
path: base + '/capability/brand',
method: 'GET',
} ),
getHelpCenterCapability: () => {
return window.NewfoldRuntime?.capabilities?.canAccessHelpCenter || false ;
},
getBrand: () => {
return window.NewfoldRuntime?.plugin?.brand || false ;
},
};

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

0 comments on commit c6a41ef

Please sign in to comment.