feat(flow): session routing contract 정리
This commit is contained in:
@@ -39,6 +39,7 @@ import { FocusTopToast } from "./FocusTopToast";
|
||||
export const SpaceWorkspaceWidget = () => {
|
||||
const searchParams = useSearchParams();
|
||||
const router = useRouter();
|
||||
const resumeIntent = searchParams.get("resume");
|
||||
const sceneQuery = searchParams.get("scene") ?? searchParams.get("room");
|
||||
const goalQuery = searchParams.get("goal")?.trim() ?? "";
|
||||
const focusPlanItemIdQuery = searchParams.get("planItemId");
|
||||
@@ -222,6 +223,8 @@ export const SpaceWorkspaceWidget = () => {
|
||||
workspaceMode === "setup" &&
|
||||
showReviewTeaserAfterComplete &&
|
||||
hasEnoughWeeklyData;
|
||||
const allowsPausedReentry =
|
||||
resumeIntent === "continue" || resumeIntent === "refocus";
|
||||
const secondaryReviewTeaser = shouldShowSecondaryReviewTeaser
|
||||
? {
|
||||
title: isPro
|
||||
@@ -242,6 +245,16 @@ export const SpaceWorkspaceWidget = () => {
|
||||
}
|
||||
}, [isBootstrapping, currentSession, hasQueryOverrides, router]);
|
||||
|
||||
useEffect(() => {
|
||||
if (isBootstrapping || !currentSession) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentSession.state === "paused" && !allowsPausedReentry) {
|
||||
router.replace("/app");
|
||||
}
|
||||
}, [allowsPausedReentry, currentSession, isBootstrapping, router]);
|
||||
|
||||
useEffect(() => {
|
||||
const preferMobile =
|
||||
typeof window !== "undefined"
|
||||
|
||||
Reference in New Issue
Block a user