Await genericPurchase completion before page reload to prevent request cancellation.
Also adds defensive check for undefined error.response in axios interceptor to prevent "t.response undefined" errors.
This commit is contained in:
@@ -209,6 +209,9 @@ export default {
|
||||
return response;
|
||||
}, error => { // Set up Error interceptors
|
||||
if (error.response.status >= 400) {
|
||||
if (!error.response) {
|
||||
return Promise.reject(error);
|
||||
}
|
||||
const isBanned = this.checkForBannedUser(error);
|
||||
if (isBanned === true) return null; // eslint-disable-line consistent-return
|
||||
|
||||
|
||||
@@ -851,7 +851,7 @@ export default {
|
||||
return;
|
||||
}
|
||||
if (this.genericPurchase) {
|
||||
this.makeGenericPurchase(this.item, 'buyModal', this.selectedAmountToBuy);
|
||||
await this.makeGenericPurchase(this.item, 'buyModal', this.selectedAmountToBuy);
|
||||
await this.purchased(this.item.text);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user