From e38dd1ddc3caf27d1c0edbdc6f79a4e294183124 Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Thu, 11 Apr 2024 00:09:41 +0300 Subject: [PATCH] fix Unlimited label between pages --- apps/web/pages/unlimited.jsx | 5 +---- apps/web/stores/index.js | 5 ++++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/apps/web/pages/unlimited.jsx b/apps/web/pages/unlimited.jsx index cce59d0..7b7fc0e 100644 --- a/apps/web/pages/unlimited.jsx +++ b/apps/web/pages/unlimited.jsx @@ -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, }, diff --git a/apps/web/stores/index.js b/apps/web/stores/index.js index 047bebe..0594192 100644 --- a/apps/web/stores/index.js +++ b/apps/web/stores/index.js @@ -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;