fix Unlimited label between pages
This commit is contained in:
parent
76accc138f
commit
e38dd1ddc3
@ -2,16 +2,12 @@ import initializeApollo from '@/apollo/client';
|
||||
import * as Calculation from '@/Components/Calculation';
|
||||
import { Error } from '@/Components/Common/Error';
|
||||
import * as hooks from '@/process/hooks';
|
||||
import { useStore } from '@/stores/hooks';
|
||||
import { getPageTitle } from '@/utils/page';
|
||||
import { makeGetUserType } from '@/utils/user';
|
||||
import { dehydrate, QueryClient } from '@tanstack/react-query';
|
||||
import Head from 'next/head';
|
||||
|
||||
function Content() {
|
||||
const store = useStore();
|
||||
store.$process.add('Unlimited');
|
||||
|
||||
hooks.useSentryScope();
|
||||
hooks.useMainData();
|
||||
hooks.useGetUsers();
|
||||
@ -61,6 +57,7 @@ export async function getServerSideProps({ req }) {
|
||||
calculation: {},
|
||||
initialApolloState: apolloClient.cache.extract(),
|
||||
initialQueryState: dehydrate(queryClient),
|
||||
mode: 'unlimited',
|
||||
statusCode: 200,
|
||||
user,
|
||||
},
|
||||
|
||||
@ -10,7 +10,7 @@ export function initializeStore(initialData) {
|
||||
const _store = store ?? new RootStore();
|
||||
|
||||
if (initialData) {
|
||||
const { calculation, tables } = initialData;
|
||||
const { calculation, tables, mode } = initialData;
|
||||
|
||||
if (calculation?.values) _store.$calculation.$values.hydrate(calculation.values);
|
||||
if (calculation?.statuses) _store.$calculation.$status.hydrate(calculation.statuses);
|
||||
@ -23,6 +23,9 @@ export function initializeStore(initialData) {
|
||||
values: tables.insurance.values,
|
||||
});
|
||||
}
|
||||
|
||||
_store.$process.clear();
|
||||
if (mode === 'unlimited') _store.$process.add('Unlimited');
|
||||
}
|
||||
|
||||
if (isServer()) return _store;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user