Skip to content

Commit

Permalink
Merge pull request #7 from XPRNetwork/fix-regstore
Browse files Browse the repository at this point in the history
Fix regstore
  • Loading branch information
SuperstrongBE authored May 10, 2024
2 parents 7209cb9 + c935410 commit f60140e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/js/admin/regstore/App.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
onMount(async ()=>{
console.log(pluginOptions)
console.log(pluginOptions,'pluginOptions')
const networkCheckbox = document.querySelector(pluginOptions.networkCheckBoxSelector);
mainnetAccountNameField = document.querySelector(pluginOptions.mainnetAccountFieldSelector);
testnetAccountNameField = document.querySelector(pluginOptions.testnetAccountFieldSelector);
Expand Down
4 changes: 3 additions & 1 deletion includes/controllers/RegStore.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public function __construct()
*/
private function registerActions()
{

add_action('admin_enqueue_scripts', [$this, 'registerScripts']);
}

Expand All @@ -48,12 +49,13 @@ public function registerScripts()
{

global $current_screen;
$baseConfig = Config::GetBaseConfig();
$baseConfig = Config::GetDashbordConfig();
$extendedConfig = [
"networkCheckBoxSelector" => "#woocommerce_wookey_testnet",
"mainnetAccountFieldSelector" => "#woocommerce_wookey_mainwallet",
"testnetAccountFieldSelector" => "#woocommerce_wookey_testwallet",
];

if (isset($current_screen) && $current_screen->id == 'woocommerce_page_wc-settings') {
wp_register_script('wookey_admin_regstore', WOOKEY_ROOT_URL . 'dist/admin/regstore/wookey.admin.regstore.iife.js?v=' . uniqid(), [], time(), true);
wp_localize_script('wookey_admin_regstore', 'wookeyRegStoreParams', array_merge($baseConfig, $extendedConfig));
Expand Down
2 changes: 2 additions & 0 deletions includes/wookey-gateway.core.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ private function loadDependencies()
require_once WOOKEY_ROOT_DIR . 'includes/controllers/Orders.php';

require_once WOOKEY_ROOT_DIR . 'includes/controllers/Refund.php';
require_once WOOKEY_ROOT_DIR . 'includes/controllers/RegStore.php';

require_once WOOKEY_ROOT_DIR . 'includes/rpc/ProtonRPC.php';
require_once WOOKEY_ROOT_DIR . 'includes/rpc/PriceRateRPC.php';
Expand All @@ -47,6 +48,7 @@ private function bootstrap()
$gateway = new \wookey\gateway\GatewayWrapper();
$dashboard = new \wookey\admin\Dashboard();
$refund = new \wookey\admin\Refund();
$regStore = new \wookey\admin\RegStore();

$orders = new \wookey\admin\Orders();
$notices = new \wookey\admin\Notices();
Expand Down

0 comments on commit f60140e

Please sign in to comment.