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 settingsRoutes from './settingsRoutes';
import adminSettingsRoutes from './adminSettingsRoutes'; import adminSettingsRoutes from './adminSettingsRoutes';
import Notifications from 'pages/Notifications'; import Notifications from 'pages/Notifications';
import useConfig from 'hooks/useConfig';
import useAuthentication from 'hooks/useAuthentication'; import useAuthentication from 'hooks/useAuthentication';
function Routes() { function Routes() {
const { config } = useConfig();
const { isAuthenticated } = useAuthentication(); const { isAuthenticated } = useAuthentication();
return ( return (
@@ -119,6 +121,7 @@ function Routes() {
} }
/> />
{!config?.disableNotificationsPage && (
<Route <Route
path={URLS.UPDATES} path={URLS.UPDATES}
element={ element={
@@ -127,6 +130,7 @@ function Routes() {
</Layout> </Layout>
} }
/> />
)}
<Route <Route
path="/" path="/"