Skip to content

Commit

Permalink
🐛 fix: fix hydration error (lobehub#5502)
Browse files Browse the repository at this point in the history
* fix code

* update dev script
  • Loading branch information
arvinxx authored Jan 18, 2025
1 parent de203d7 commit cbe469a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"db:push-test": "NODE_ENV=test drizzle-kit push",
"db:studio": "drizzle-kit studio",
"db:z-pull": "drizzle-kit introspect",
"dev": "next dev --turbo -p 3010",
"dev": "next dev --turbopack -p 3010",
"docs:i18n": "lobe-i18n md && npm run lint:md && npm run lint:mdx",
"docs:seo": "lobe-seo && npm run lint:mdx",
"i18n": "npm run workflow:i18n && lobe-i18n",
Expand Down
6 changes: 1 addition & 5 deletions src/hooks/useInterceptingRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import urlJoin from 'url-join';
import { INBOX_SESSION_ID } from '@/const/session';
import { useIsMobile } from '@/hooks/useIsMobile';
import { useQueryRoute } from '@/hooks/useQueryRoute';
import { useGlobalStore } from '@/store/global';
import { ChatSettingsTabs, SettingsTabs, SidebarTabKey } from '@/store/global/initialState';
import { ChatSettingsTabs, SettingsTabs } from '@/store/global/initialState';
import { useSessionStore } from '@/store/session';

export const useOpenChatSettings = (tab: ChatSettingsTabs = ChatSettingsTabs.Meta) => {
Expand All @@ -15,9 +14,6 @@ export const useOpenChatSettings = (tab: ChatSettingsTabs = ChatSettingsTabs.Met

return useMemo(() => {
if (activeId === INBOX_SESSION_ID) {
useGlobalStore.setState({
sidebarKey: SidebarTabKey.Setting,
});
return () => router.push(urlJoin('/settings', SettingsTabs.Agent));
}
if (mobile) {
Expand Down
5 changes: 3 additions & 2 deletions src/libs/trpc/client/lambda.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ import { createTRPCClient, httpBatchLink } from '@trpc/client';
import { createTRPCReact } from '@trpc/react-query';
import superjson from 'superjson';

import { fetchErrorNotification } from '@/components/Error/fetchErrorNotification';
import { loginRequired } from '@/components/Error/loginRequiredNotification';
import { ModelProvider } from '@/libs/agent-runtime';
import type { LambdaRouter } from '@/server/routers/lambda';

Expand All @@ -17,6 +15,9 @@ const links = [

const errorRes: ErrorResponse = await response.clone().json();

const { loginRequired } = await import('@/components/Error/loginRequiredNotification');
const { fetchErrorNotification } = await import('@/components/Error/fetchErrorNotification');

errorRes.forEach((item) => {
const errorData = item.error.json;

Expand Down

0 comments on commit cbe469a

Please sign in to comment.