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