diff --git a/apps/web/pages/index.jsx b/apps/web/pages/index.jsx
index 475d3d2..41f4da5 100644
--- a/apps/web/pages/index.jsx
+++ b/apps/web/pages/index.jsx
@@ -11,13 +11,13 @@ import { dehydrate, QueryClient } from '@tanstack/react-query';
import Head from 'next/head';
export default function Home(props) {
+ if (props.statusCode !== 200) return ;
+
hooks.useSentryScope();
hooks.useMainData();
hooks.useInsuranceData();
hooks.useReactions();
- if (props.statusCode !== 200) return ;
-
return (
@@ -61,7 +61,10 @@ export const makeGetServerSideProps = ({ roles }) =>
if (!systemuser?.roles?.some((x) => x?.name && roles.includes(x.name))) {
return {
- props: { statusCode: 403 },
+ props: {
+ initialQueryState: dehydrate(queryClient),
+ statusCode: 403,
+ },
};
}
@@ -77,6 +80,7 @@ export const makeGetServerSideProps = ({ roles }) =>
return {
props: {
error: JSON.stringify(error),
+ initialQueryState: dehydrate(queryClient),
statusCode: 500,
},
};
diff --git a/apps/web/pages/unlimited.jsx b/apps/web/pages/unlimited.jsx
index 9e36cf5..b21af4e 100644
--- a/apps/web/pages/unlimited.jsx
+++ b/apps/web/pages/unlimited.jsx
@@ -12,14 +12,14 @@ export default function Unlimited(props) {
const store = useStore();
store.$process.add('Unlimited');
+ if (props.statusCode !== 200) return ;
+
hooks.useSentryScope();
hooks.useMainData();
hooks.useGetUsers();
hooks.useInsuranceData();
hooks.useReactions();
- if (props.statusCode !== 200) return ;
-
return (