mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-30 05:00:51 +08:00
Block UI during onApprove callback on block components
This commit is contained in:
parent
af7d4c7524
commit
8ce9e94bbb
1 changed files with 7 additions and 0 deletions
|
@ -3,6 +3,7 @@ import {
|
|||
paypalSubscriptionToWcAddresses,
|
||||
} from './Helper/Address';
|
||||
import ResumeFlowHelper from '../../../ppcp-button/resources/js/modules/Helper/ResumeFlowHelper';
|
||||
import Spinner from '../../../ppcp-button/resources/js/modules/Helper/Spinner';
|
||||
|
||||
export const createOrder = async ( data, config, onError, onClose ) => {
|
||||
try {
|
||||
|
@ -66,6 +67,10 @@ export const handleApprove = async (
|
|||
onError,
|
||||
onClose
|
||||
) => {
|
||||
// Block the entire page during approval process
|
||||
const spinner = Spinner.fullPage();
|
||||
spinner.block();
|
||||
|
||||
try {
|
||||
let order;
|
||||
|
||||
|
@ -173,6 +178,8 @@ export const handleApprove = async (
|
|||
onClose();
|
||||
|
||||
throw err;
|
||||
} finally {
|
||||
spinner.unblock();
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue