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