feat: do not let users access notifications page when it's turned off (#1583)

This commit is contained in:
kattoczko
2024-02-16 15:15:01 +00:00
committed by GitHub
parent be7e67c940
commit e2d803ebf7

View File

@@ -18,9 +18,11 @@ import * as URLS from 'config/urls';
import settingsRoutes from './settingsRoutes';
import adminSettingsRoutes from './adminSettingsRoutes';
import Notifications from 'pages/Notifications';
import useConfig from 'hooks/useConfig';
import useAuthentication from 'hooks/useAuthentication';
function Routes() {
const { config } = useConfig();
const { isAuthenticated } = useAuthentication();
return (
@@ -119,14 +121,16 @@ function Routes() {
}
/>
<Route
path={URLS.UPDATES}
element={
<Layout>
<Notifications />
</Layout>
}
/>
{!config?.disableNotificationsPage && (
<Route
path={URLS.UPDATES}
element={
<Layout>
<Notifications />
</Layout>
}
/>
)}
<Route
path="/"