mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-05 08:59:14 +08:00
Improve spinner before redirect
This commit is contained in:
parent
9370eba320
commit
87aed70199
1 changed files with 5 additions and 1 deletions
|
@ -23,16 +23,20 @@ class FreeTrialHandler {
|
|||
return_url: location.href
|
||||
}),
|
||||
}).then(res => {
|
||||
this.spinner.unblock()
|
||||
return res.json();
|
||||
}).then(data => {
|
||||
if (!data.success) {
|
||||
this.spinner.unblock();
|
||||
console.error(data);
|
||||
this.errorHandler.message(data.data.message);
|
||||
throw Error(data.data.message);
|
||||
}
|
||||
|
||||
location.href = data.data.approve_link;
|
||||
}).catch(error => {
|
||||
this.spinner.unblock();
|
||||
console.error(error);
|
||||
this.errorHandler.genericError();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue