make sure restart action exists

This commit is contained in:
David Remer 2020-07-16 13:41:14 +03:00
parent ec199d2bfc
commit 514619ed8d

View file

@ -11,7 +11,10 @@ const onApprove = (context, errorHandler) => {
}).then((data)=>{
if (!data.success) {
errorHandler.message(data.data);
return actions.restart();
if (typeof actions.restart !== 'undefined') {
return actions.restart();
}
throw new Error(data.data);
}
document.querySelector('#place_order').click()
});