From 8def9cfea155056369a8a6371021f7e3520d73fc Mon Sep 17 00:00:00 2001 From: Halil Beycan <50718965+BeycanDeveloper@users.noreply.github.com> Date: Wed, 27 Mar 2024 18:55:54 +0800 Subject: [PATCH] updated --- assets/js/main.js | 5 +++++ dokan-cryptopay-withdrawal.php | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/assets/js/main.js b/assets/js/main.js index 58270c2..ffc0447 100644 --- a/assets/js/main.js +++ b/assets/js/main.js @@ -2,6 +2,7 @@ $(document).ready(() => { let CryptoPayApp; + const __ = wp.i18n.__; const modal = $(".dokan-cryptopay-modal"); $(window).on('click', function(e) { @@ -46,6 +47,8 @@ window.CryptoPayApp.events.add('transactionReceived', ({transaction}) => { approve.trigger('click'); + $(this).prop('disabled', true) + $(this).text(__('Processing...')) cpHelpers.successPopup(window.CryptoPayLang.transactionSent, ` ${window.CryptoPayLang.openInExplorer} @@ -74,6 +77,8 @@ window.CryptoPayLiteApp.events.add('transactionReceived', ({transaction}) => { approve.trigger('click'); + $(this).prop('disabled', true) + $(this).text(__('Processing...')) cplHelpers.successPopup(window.CryptoPayLiteLang.transactionSent, ` ${window.CryptoPayLiteLang.openInExplorer} diff --git a/dokan-cryptopay-withdrawal.php b/dokan-cryptopay-withdrawal.php index cfdd666..6d900ea 100644 --- a/dokan-cryptopay-withdrawal.php +++ b/dokan-cryptopay-withdrawal.php @@ -63,7 +63,7 @@ if (isset($_GET['page']) && 'dokan' === $_GET['page']) { add_action('admin_enqueue_scripts', function (): void { - wp_enqueue_script('dokan-cryptopay', plugin_dir_url(__FILE__) . 'assets/js/main.js', ['jquery'], DOKAN_CRYPTOPAY_VERSION, true); + wp_enqueue_script('dokan-cryptopay', plugin_dir_url(__FILE__) . 'assets/js/main.js', ['jquery', 'wp-i18n'], DOKAN_CRYPTOPAY_VERSION, true); wp_localize_script('dokan-cryptopay', 'DokanCryptoPay', [ 'currency' => get_woocommerce_currency(), 'apiUrl' => home_url('/wp-json/dokan/v1/withdraw/')