fix(chat): make Home pass react-hooks lint after the split
eslint-plugin-react-hooks now analyzes the smaller Home, so render-time ref writes and sync effect setState were failing the staging gate. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -87,6 +87,8 @@ export type ProfileOnboardingParams = {
|
||||
setStartGreeting: Dispatch<SetStateAction<string>>;
|
||||
signingOut: boolean;
|
||||
uiPreview: MutableRefObject<boolean>;
|
||||
guidedBirthTimeReadyRef: MutableRefObject<(result: JourneyClientResponse) => void>;
|
||||
editDeclaredBirthTimeDetailsRef: MutableRefObject<() => void>;
|
||||
};
|
||||
|
||||
export function useProfileOnboarding(params: ProfileOnboardingParams) {
|
||||
@@ -127,6 +129,8 @@ export function useProfileOnboarding(params: ProfileOnboardingParams) {
|
||||
setStartGreeting,
|
||||
signingOut,
|
||||
uiPreview,
|
||||
guidedBirthTimeReadyRef,
|
||||
editDeclaredBirthTimeDetailsRef,
|
||||
} = params;
|
||||
|
||||
async function refreshAccount() {
|
||||
@@ -405,6 +409,9 @@ export function useProfileOnboarding(params: ProfileOnboardingParams) {
|
||||
}
|
||||
}
|
||||
|
||||
guidedBirthTimeReadyRef.current = completeGuidedBirthTime;
|
||||
editDeclaredBirthTimeDetailsRef.current = editDeclaredBirthTimeDetails;
|
||||
|
||||
return {
|
||||
refreshAccount,
|
||||
openAccountDialog,
|
||||
|
||||
@@ -64,6 +64,7 @@ export type RectificationSurfaceParams = {
|
||||
updateSession: (sessionId: string, change: (session: ChatSession) => ChatSession) => void;
|
||||
openAccountDialog: (dialog: AccountDialog, returnTarget?: HTMLButtonElement | null) => void;
|
||||
refreshAccount: () => Promise<void>;
|
||||
rectificationSessionOpenerRef: MutableRefObject<(exactSessionId: string) => Promise<void>>;
|
||||
};
|
||||
|
||||
export function useRectificationSurface(params: RectificationSurfaceParams) {
|
||||
@@ -103,6 +104,7 @@ export function useRectificationSurface(params: RectificationSurfaceParams) {
|
||||
updateSession,
|
||||
openAccountDialog,
|
||||
refreshAccount,
|
||||
rectificationSessionOpenerRef,
|
||||
} = params;
|
||||
|
||||
async function refreshRectificationEntrySummary() {
|
||||
@@ -267,6 +269,7 @@ export function useRectificationSurface(params: RectificationSurfaceParams) {
|
||||
sessionSelectionSource.current = "history";
|
||||
void openRectificationSession(session.id);
|
||||
};
|
||||
rectificationSessionOpenerRef.current = openRectificationSession;
|
||||
|
||||
function handleRectificationProfileIncomplete() {
|
||||
setRectificationError("profile_incomplete");
|
||||
|
||||
@@ -117,6 +117,7 @@ export function useSessionManagement(params: SessionManagementParams) {
|
||||
visibleSessions,
|
||||
openRectificationSession,
|
||||
} = params;
|
||||
sessionsRef.current = sessions;
|
||||
|
||||
function updateSession(sessionId: string, change: (session: ChatSession) => ChatSession) {
|
||||
setSessions((current) => current.map((session) => (session.id === sessionId ? change(session) : session)));
|
||||
|
||||
Reference in New Issue
Block a user