mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
Refactor env check.
This commit is contained in:
parent
ba63991a92
commit
fc9584eb44
14 changed files with 30 additions and 76 deletions
|
|
@ -4,12 +4,12 @@ import Layout from 'components/layout/Layout';
|
|||
import WebsiteDetails from 'components/pages/WebsiteDetails';
|
||||
import useRequireLogin from 'hooks/useRequireLogin';
|
||||
|
||||
export default function DetailsPage({ pageDisabled }) {
|
||||
export default function DetailsPage() {
|
||||
const { loading } = useRequireLogin();
|
||||
const router = useRouter();
|
||||
const { id } = router.query;
|
||||
|
||||
if (pageDisabled || !id || loading) {
|
||||
if (!id || loading) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -21,11 +21,3 @@ export default function DetailsPage({ pageDisabled }) {
|
|||
</Layout>
|
||||
);
|
||||
}
|
||||
|
||||
export async function getServerSideProps() {
|
||||
return {
|
||||
props: {
|
||||
pageDisabled: !!process.env.DISABLE_UI,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue