Improve spinner before redirect

This commit is contained in:
Alex P 2022-04-12 18:40:24 +03:00
parent 9370eba320
commit 87aed70199

View file

@ -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();
}); });
} }
} }