Refactor env check.

This commit is contained in:
Mike Cao 2022-10-27 16:42:57 -07:00
parent ba63991a92
commit fc9584eb44
14 changed files with 30 additions and 76 deletions

View file

@ -3,10 +3,10 @@ import Layout from 'components/layout/Layout';
import RealtimeDashboard from 'components/pages/RealtimeDashboard';
import useRequireLogin from 'hooks/useRequireLogin';
export default function RealtimePage({ pageDisabled }) {
export default function RealtimePage() {
const { loading } = useRequireLogin();
if (pageDisabled || loading) {
if (loading) {
return null;
}
@ -16,11 +16,3 @@ export default function RealtimePage({ pageDisabled }) {
</Layout>
);
}
export async function getServerSideProps() {
return {
props: {
pageDisabled: !!process.env.DISABLE_UI,
},
};
}