From 17728f28f0db7881bdb7f50c404220661b10dc2d Mon Sep 17 00:00:00 2001 From: Nikita Sinelnikov Date: Fri, 2 Dec 2022 11:40:50 +0200 Subject: [PATCH] Update utils.js avoid the ajax loader duplicates --- assets/js/frontend/checkout/utils.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/assets/js/frontend/checkout/utils.js b/assets/js/frontend/checkout/utils.js index 9fbed7bdfa7..d129436da30 100644 --- a/assets/js/frontend/checkout/utils.js +++ b/assets/js/frontend/checkout/utils.js @@ -72,7 +72,10 @@ export function recalculateTaxes( state ) { current_page: edd_global_vars.current_page, }; - jQuery( '#edd_purchase_submit [type=submit]' ).after( '' ); + // avoid duplicates https://cdn.screencast.com/uploads/g000302DdsRr7R9TdDPsCsJ7RE6kr/LWR_Recording.png?sv=2021-08-06&st=2022-12-02T09%3A35%3A05Z&se=2022-12-03T09%3A35%3A05Z&sr=b&sp=r&sig=tyuREJgE0tt6lacNYdZ0bzTWJyZnbldDxRQ5icT5VKw%3D + if ( ! jQuery( '#edd_purchase_submit [type=submit]' ).siblings('.edd-loading-ajax.edd-recalculate-taxes-loading').length ) { + jQuery( '#edd_purchase_submit [type=submit]' ).after( '' ); + } const current_ajax_count = ++ajax_tax_count;