Files
DeepTutor/web/components/workspaces/WorkspaceRuntimeBoundary.tsx
Bingxi Zhao (Frank) da856ad670 release: v1.6.9
Ship folder-based workspaces and data migration, daily practice, redesigned
provider and model settings, and streaming conversation improvements.
Synchronize README translations and document the archive/permanent-delete
upgrade behavior in assets/releases/ver1-6-9.md.

Reduce initial JavaScript by deduplicating English resources and loading
animation features after hydration. Keep the existing route size budgets.
Update regression fixtures and browser audits for scoped URLs and the new
settings and learning interfaces.
2026-09-21 02:30:40 +08:00

22 lines
806 B
TypeScript

'use client'
import { Fragment, useEffect, type ReactNode } from 'react'
import { useSearchParams } from 'next/navigation'
import { resetReadingTurnState } from '@/lib/reading-turn-state'
import { resetWatchingTurnState } from '@/lib/watching-turn-state'
function ScopeLifetime({ children }: { children: ReactNode }) {
useEffect(() => () => {
resetReadingTurnState()
resetWatchingTurnState()
}, [])
return children
}
/** Reset content state even for query-only navigation and browser back/forward. */
export function WorkspaceRuntimeBoundary({ children }: { children: ReactNode }) {
const query = useSearchParams()
const workspaceId = query.get('dt_workspace') ?? query.get('workspace') ?? ''
return <Fragment key={workspaceId}><ScopeLifetime>{children}</ScopeLifetime></Fragment>
}