feat: do not let users access notifications page when it's turned off (#1583)
This commit is contained in:
@@ -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="/"
|
||||||
|
Reference in New Issue
Block a user