Skip to content
TypeScript

perf(web): the first-run gate compiles with the React Compiler (#20637)

Julius Marminge478b06c60972
diff --git a/apps/web/src/components/onboarding/FirstRunGate.tsx b/apps/web/src/components/onboarding/FirstRunGate.tsx
index a985df61559..c76b5b1f7f3 100644
--- a/apps/web/src/components/onboarding/FirstRunGate.tsx
+++ b/apps/web/src/components/onboarding/FirstRunGate.tsx
@@ -136,24 +136,20 @@ export function FirstRunGate({
threadCount: threads.length,
});
+ if (decision !== "wizard" && hydrated) {
+ const transitioned = transitionFirstRunGateState(gateState, {
+ type: "evidence",
+ decision: nextDecision,
+ });
+ if (transitioned !== gateState) setGateState(transitioned);
+ }
+
useEffect(() => {
if (decision === "wizard" || !hydrated) return;
-
if (persistCompletion && onboardingCompletedAt === null) {
void completeOnboarding().catch(() => undefined);
}
-
- setGateState((state) =>
- transitionFirstRunGateState(state, { type: "evidence", decision: nextDecision }),
- );
- }, [
- completeOnboarding,
- decision,
- hydrated,
- nextDecision,
- onboardingCompletedAt,
- persistCompletion,
- ]);
+ }, [completeOnboarding, decision, hydrated, onboardingCompletedAt, persistCompletion]);
useEffect(() => {
if (!enabled || decision !== "pending" || !hydrated) return;