mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-10 08:26:55 +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
|
return_url: location.href
|
||||||
}),
|
}),
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
this.spinner.unblock()
|
|
||||||
return res.json();
|
return res.json();
|
||||||
}).then(data => {
|
}).then(data => {
|
||||||
if (!data.success) {
|
if (!data.success) {
|
||||||
|
this.spinner.unblock();
|
||||||
console.error(data);
|
console.error(data);
|
||||||
this.errorHandler.message(data.data.message);
|
this.errorHandler.message(data.data.message);
|
||||||
throw Error(data.data.message);
|
throw Error(data.data.message);
|
||||||
}
|
}
|
||||||
|
|
||||||
location.href = data.data.approve_link;
|
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