mirror of
https://github.com/lowdefy/lowdefy.git
synced 2025-03-31 15:20:32 +08:00
Merge pull request #1206 from lowdefy/fix-dev-server-react-hooks
fix(server-dev): Fix react hooks used incorrectly.
This commit is contained in:
commit
9569df4e98
@ -24,11 +24,11 @@ import usePageConfig from './utils/usePageConfig.js';
|
||||
|
||||
const Page = ({ Components, config, pageId, resetContext, router, types }) => {
|
||||
const { data: session, status } = useSession();
|
||||
const { data: pageConfig } = usePageConfig(pageId, router.basePath);
|
||||
|
||||
if (status === 'loading') {
|
||||
return '';
|
||||
}
|
||||
const { data: pageConfig } = usePageConfig(pageId, router.basePath);
|
||||
if (!pageConfig) {
|
||||
router.replace(`/404`);
|
||||
return '';
|
||||
|
Loading…
x
Reference in New Issue
Block a user