Web: Added error handler.
This commit is contained in:
parent
95a35bcad3
commit
511c9d0bef
@ -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,
|
||||
|
@ -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 () => {
|
||||
try {
|
||||
const res = await api.portal.getPortalQuota();
|
||||
|
||||
if (!res) return;
|
||||
|
||||
this.setIsLoaded(true);
|
||||
|
||||
this.setPortalQuotaValue(res);
|
||||
} catch (e) {
|
||||
toastr.error(e);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user