Refactored fetching to use react-query.

This commit is contained in:
Mike Cao committed 2022-12-28 15:43:22 -08:00
1 parent 7bbed0e12b
commit c56f02c475
112 files changed
+255 -492

No files matched your search

+1 -4
View File
@@ -1,8 +1,6 @@
import React from 'react';
import { useRouter } from 'next/router';
import Layout from 'components/layout/Layout';
import Dashboard from 'components/pages/Dashboard';
import useRequireLogin from 'hooks/useRequireLogin';
import useUser from 'hooks/useUser';
import useConfig from 'hooks/useConfig';
@@ -12,11 +10,10 @@ export default function DashboardPage() {
isReady,
asPath,
} = useRouter();
const { loading } = useRequireLogin();
const user = useUser();
const { adminDisabled } = useConfig();
if (adminDisabled || !user || !isReady || loading) {
if (adminDisabled || !user || !isReady) {
return null;
}