Fix sentry issue (#6719)
https://twenty-v7.sentry.io/issues/5677123076/?environment=prod&project=4507072499810304&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D&referrer=issue-stream&statsPeriod=7d&stream_index=12 Removes billing section when is_free_access_enabled
This commit is contained in:
@ -3,7 +3,6 @@ import {
|
||||
createBrowserRouter,
|
||||
createRoutesFromElements,
|
||||
Outlet,
|
||||
redirect,
|
||||
Route,
|
||||
RouterProvider,
|
||||
Routes,
|
||||
@ -192,14 +191,12 @@ const createRouter = (
|
||||
path={SettingsPath.AccountsEmails}
|
||||
element={<SettingsAccountsEmails />}
|
||||
/>
|
||||
<Route
|
||||
path={SettingsPath.Billing}
|
||||
element={<SettingsBilling />}
|
||||
loader={() => {
|
||||
if (!isBillingEnabled) return redirect(AppPath.Index);
|
||||
return null;
|
||||
}}
|
||||
/>
|
||||
{isBillingEnabled && (
|
||||
<Route
|
||||
path={SettingsPath.Billing}
|
||||
element={<SettingsBilling />}
|
||||
/>
|
||||
)}
|
||||
<Route
|
||||
path={SettingsPath.WorkspaceMembersPage}
|
||||
element={<SettingsWorkspaceMembers />}
|
||||
@ -324,15 +321,19 @@ const createRouter = (
|
||||
|
||||
export const App = () => {
|
||||
const billing = useRecoilValue(billingState);
|
||||
const isFreeAccessEnabled = useIsFeatureEnabled('IS_FREE_ACCESS_ENABLED');
|
||||
const isCRMMigrationEnabled = useIsFeatureEnabled('IS_CRM_MIGRATION_ENABLED');
|
||||
const isServerlessFunctionSettingsEnabled = useIsFeatureEnabled(
|
||||
'IS_FUNCTION_SETTINGS_ENABLED',
|
||||
);
|
||||
|
||||
const isBillingPageEnabled =
|
||||
billing?.isBillingEnabled && !isFreeAccessEnabled;
|
||||
|
||||
return (
|
||||
<RouterProvider
|
||||
router={createRouter(
|
||||
billing?.isBillingEnabled,
|
||||
isBillingPageEnabled,
|
||||
isCRMMigrationEnabled,
|
||||
isServerlessFunctionSettingsEnabled,
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user