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 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="/"
|
||||
|
Reference in New Issue
Block a user