Web: Added error handler.

This commit is contained in:
Tatiana Lopaeva 2023-03-10 17:09:03 +03:00
parent 95a35bcad3
commit 511c9d0bef
2 changed files with 18 additions and 7 deletions

View File

@ -110,21 +110,26 @@ class PaymentStore {
await Promise.all(requests);
this.setRangeStepByQuota();
this.setTariffDates();
if (!this.isAlreadyPaid) this.isInitPaymentPage = true;
} catch (error) {
toastr.error(error);
return;
}
try {
if (this.isAlreadyPaid) this.payerInfo = await getUserByEmail(customerId);
this.isInitPaymentPage = true;
} catch (e) {
console.error(e);
}
this.isInitPaymentPage = true;
};
getSettingsPayment = async () => {
const newSettings = await getPaymentSettings();
if (!newSettings) return;
const {
buyUrl,
salesEmail,

View File

@ -2,6 +2,7 @@ import { makeAutoObservable } from "mobx";
import api from "../api";
import { PortalFeaturesLimitations } from "../constants";
import toastr from "@docspace/components/toast/toastr";
const MANAGER = "manager";
const TOTAL_SIZE = "total_size";
@ -23,8 +24,6 @@ class QuotasStore {
if (this.isLoaded) return;
await this.setPortalQuota();
this.setIsLoaded(true);
};
setIsLoaded = (isLoaded) => {
@ -181,10 +180,17 @@ class QuotasStore {
this.currentPortalQuotaFeatures = res.features;
};
setPortalQuota = async () => {
const res = await api.portal.getPortalQuota();
if (!res) return;
try {
const res = await api.portal.getPortalQuota();
this.setPortalQuotaValue(res);
if (!res) return;
this.setIsLoaded(true);
this.setPortalQuotaValue(res);
} catch (e) {
toastr.error(e);
}
};
}