mirror of
https://github.com/langgenius/dify.git
synced 2026-05-10 05:56:31 +08:00
fix: skip ssr for main app
This commit is contained in:
parent
b9ddd7047c
commit
c3f52f8fa0
@ -8,7 +8,7 @@ export function HydrateClient({
|
||||
children,
|
||||
}: {
|
||||
isMarketplacePlatform?: boolean
|
||||
children?: React.ReactNode
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
useHydrateAtoms([
|
||||
[isMarketplacePlatformAtom, isMarketplacePlatform],
|
||||
|
||||
@ -252,13 +252,15 @@ async function getDehydratedState(
|
||||
export async function HydrateQueryClient({
|
||||
params,
|
||||
searchParams,
|
||||
isMarketplacePlatform = false,
|
||||
children,
|
||||
}: {
|
||||
params?: Awaitable<{ category?: string, creationType?: string, searchTab?: string } | undefined>
|
||||
searchParams?: Awaitable<SearchParams>
|
||||
isMarketplacePlatform?: boolean
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
const dehydratedState = await getDehydratedState(params, searchParams)
|
||||
const dehydratedState = isMarketplacePlatform ? await getDehydratedState(params, searchParams) : null
|
||||
|
||||
return (
|
||||
<HydrationBoundary state={dehydratedState}>
|
||||
|
||||
@ -30,8 +30,14 @@ const Marketplace = ({
|
||||
}: MarketplaceProps) => {
|
||||
return (
|
||||
<TanstackQueryInitializer>
|
||||
<HydrateQueryClient searchParams={searchParams} params={params}>
|
||||
<HydrateClient isMarketplacePlatform={isMarketplacePlatform}>
|
||||
<HydrateQueryClient
|
||||
isMarketplacePlatform={isMarketplacePlatform}
|
||||
searchParams={searchParams}
|
||||
params={params}
|
||||
>
|
||||
<HydrateClient
|
||||
isMarketplacePlatform={isMarketplacePlatform}
|
||||
>
|
||||
<MarketplaceHeader descriptionClassName={cn('mx-12 mt-1', isMarketplacePlatform && 'top-0 mx-0 mt-0 rounded-none')} marketplaceNav={marketplaceNav} />
|
||||
<MarketplaceContent
|
||||
showInstallButton={showInstallButton}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user