fix(flow): app entry를 no-session 전용으로 단순화
This commit is contained in:
@@ -39,7 +39,6 @@ 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");
|
||||
@@ -104,7 +103,6 @@ export const SpaceWorkspaceWidget = () => {
|
||||
const [pendingSessionEntryPoint, setPendingSessionEntryPoint] =
|
||||
useState<SessionEntryPoint>("space-setup");
|
||||
const [showReviewTeaserAfterComplete, setShowReviewTeaserAfterComplete] = useState(false);
|
||||
const [hasConsumedEntryOverlayIntent, setHasConsumedEntryOverlayIntent] = useState(false);
|
||||
|
||||
const {
|
||||
selectedPresetId,
|
||||
@@ -225,16 +223,7 @@ export const SpaceWorkspaceWidget = () => {
|
||||
workspaceMode === "setup" &&
|
||||
showReviewTeaserAfterComplete &&
|
||||
hasEnoughWeeklyData;
|
||||
const allowsPausedReentry =
|
||||
resumeIntent === "continue" || resumeIntent === "refocus";
|
||||
const didResolveEntryRouteRef = useRef(false);
|
||||
const didHandleResumeIntentRef = useRef(false);
|
||||
const entryOverlayIntent =
|
||||
!hasConsumedEntryOverlayIntent &&
|
||||
resumeIntent === "refocus" &&
|
||||
currentSession?.state === "paused"
|
||||
? "resume-refocus"
|
||||
: null;
|
||||
const secondaryReviewTeaser = shouldShowSecondaryReviewTeaser
|
||||
? {
|
||||
title: isPro
|
||||
@@ -265,33 +254,7 @@ export const SpaceWorkspaceWidget = () => {
|
||||
if (!currentSession) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (currentSession.state === "paused" && !allowsPausedReentry) {
|
||||
router.replace("/app");
|
||||
}
|
||||
}, [allowsPausedReentry, currentSession, isBootstrapping, router]);
|
||||
|
||||
useEffect(() => {
|
||||
if (
|
||||
isBootstrapping ||
|
||||
!currentSession ||
|
||||
currentSession.state !== "paused" ||
|
||||
didHandleResumeIntentRef.current
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (resumeIntent === "continue") {
|
||||
didHandleResumeIntentRef.current = true;
|
||||
router.replace("/space");
|
||||
void handleStartRequested();
|
||||
return;
|
||||
}
|
||||
|
||||
if (resumeIntent === "refocus") {
|
||||
return;
|
||||
}
|
||||
}, [currentSession, handleStartRequested, isBootstrapping, resumeIntent, router]);
|
||||
}, [currentSession, isBootstrapping, router]);
|
||||
|
||||
useEffect(() => {
|
||||
const preferMobile =
|
||||
@@ -390,12 +353,7 @@ export const SpaceWorkspaceWidget = () => {
|
||||
canStartSession={controls.canStartSession}
|
||||
canPauseSession={controls.canPauseSession}
|
||||
canRestartSession={controls.canRestartSession}
|
||||
entryOverlayIntent={entryOverlayIntent}
|
||||
returnPromptMode={awayReturnRecovery.returnPromptMode}
|
||||
onEntryOverlayIntentHandled={() => {
|
||||
setHasConsumedEntryOverlayIntent(true);
|
||||
router.replace("/space");
|
||||
}}
|
||||
onStartRequested={() => {
|
||||
void handleStartRequested();
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user