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); await Promise.all(requests);
this.setRangeStepByQuota(); this.setRangeStepByQuota();
this.setTariffDates(); this.setTariffDates();
if (!this.isAlreadyPaid) this.isInitPaymentPage = true;
} catch (error) { } catch (error) {
toastr.error(error); toastr.error(error);
return;
} }
try { try {
if (this.isAlreadyPaid) this.payerInfo = await getUserByEmail(customerId); if (this.isAlreadyPaid) this.payerInfo = await getUserByEmail(customerId);
this.isInitPaymentPage = true;
} catch (e) { } catch (e) {
console.error(e); console.error(e);
} }
this.isInitPaymentPage = true;
}; };
getSettingsPayment = async () => { getSettingsPayment = async () => {
const newSettings = await getPaymentSettings(); const newSettings = await getPaymentSettings();
if (!newSettings) return;
const { const {
buyUrl, buyUrl,
salesEmail, salesEmail,

View File

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