mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 05:59:36 +08:00
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.
22 lines
806 B
TypeScript
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>
|
|
}
|