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:
Hafiz
2025-08-12 10:26:02 -05:00
parent 9a1fb18959
commit 39cad77f7d
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -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);
}
}