Web: fixed direct payment url.

This commit is contained in:
Tatiana Lopaeva 2023-05-08 17:19:43 +03:00
parent 80abcf982c
commit 5356b579db
2 changed files with 17 additions and 19 deletions

View File

@ -1,20 +1,34 @@
import React from "react";
import React, { useEffect } from "react";
import { inject, observer } from "mobx-react";
import { withRouter } from "react-router";
import PaymentsEnterprise from "./Standalone";
import PaymentsSaaS from "./SaaS";
import { combineUrl } from "@docspace/common/utils";
import history from "@docspace/common/history";
const PaymentsPage = (props) => {
const { standalone } = props;
const { standalone, isEnterpriseEdition } = props;
useEffect(() => {
if (!isEnterpriseEdition) {
history.push(
combineUrl(window.DocSpaceConfig?.proxy?.url, "/portal-settings/")
);
}
}, []);
if (standalone && !isEnterpriseEdition) return <></>;
return standalone ? <PaymentsEnterprise /> : <PaymentsSaaS />;
};
export default inject(({ auth }) => {
const { settingsStore } = auth;
const { settingsStore, isEnterpriseEdition } = auth;
const { standalone } = settingsStore;
return {
isEnterpriseEdition,
standalone,
};
})(withRouter(observer(PaymentsPage)));

View File

@ -31,7 +31,6 @@ const PrivateRoute = ({ component: Component, ...rest }) => {
withManager,
withCollaborator,
isLogout,
isEnterpriseEdition,
} = rest;
const { params, path } = computedMatch;
@ -138,19 +137,6 @@ const PrivateRoute = ({ component: Component, ...rest }) => {
);
}
if (isPaymentsUrl && !isEnterpriseEdition) {
return (
<Redirect
to={{
pathname: combineUrl(
window.DocSpaceConfig?.proxy?.url,
"/portal-settings/"
),
}}
/>
);
}
if (
isNotPaidPeriod &&
isLoaded &&
@ -256,7 +242,6 @@ export default inject(({ auth }) => {
settingsStore,
currentTariffStatusStore,
isLogout,
isEnterpriseEdition,
} = auth;
const { isNotPaidPeriod } = currentTariffStatusStore;
const { user } = userStore;
@ -269,7 +254,6 @@ export default inject(({ auth }) => {
} = settingsStore;
return {
isEnterpriseEdition,
isNotPaidPeriod,
user,
isAuthenticated,