mirror of
https://github.com/kremalicious/umami.git
synced 2024-11-15 17:55:08 +01:00
Define uiDisabled at build time.
This commit is contained in:
parent
fc9584eb44
commit
98835bbc78
@ -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',
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user