diff --git a/next.config.js b/next.config.js index 0401516c..b95c39d4 100644 --- a/next.config.js +++ b/next.config.js @@ -36,6 +36,7 @@ module.exports = { env: { currentVersion: pkg.version, isProduction: process.env.NODE_ENV === 'production', + uiDisabled: !!process.env.DISABLE_UI, }, basePath: process.env.BASE_PATH, output: 'standalone', diff --git a/pages/_app.js b/pages/_app.js index 655f9fad..db4bb6e5 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -2,7 +2,6 @@ import Head from 'next/head'; import { useRouter } from 'next/router'; import { IntlProvider } from 'react-intl'; import useLocale from 'hooks/useLocale'; -import useConfig from 'hooks/useConfig'; import 'styles/variables.css'; import 'styles/bootstrap-grid.css'; import 'styles/index.css'; @@ -24,9 +23,8 @@ const Intl = ({ children }) => { export default function App({ Component, pageProps }) { const { basePath } = useRouter(); const { dir } = useLocale(); - const { uiDisabled } = useConfig(); - if (uiDisabled) { + if (!process.env.uiDisabled) { return null; } diff --git a/pages/api/config.js b/pages/api/config.js index 1facd45d..faf94c0b 100644 --- a/pages/api/config.js +++ b/pages/api/config.js @@ -7,9 +7,7 @@ export default async (req, res) => { trackerScriptName: process.env.TRACKER_SCRIPT_NAME, updatesDisabled: !!process.env.DISABLE_UPDATES, telemetryDisabled: !!process.env.DISABLE_TELEMETRY, - loginDisabled: !!process.env.DISABLE_LOGIN, adminDisabled: !!process.env.DISABLE_ADMIN, - uiDisabled: !!process.env.DISABLE_UI, }); }