Skip to content

Commit a7a2fae

Browse files
committed
refactor(web): remove redundant double parse of diff route search params
`rawSearch` is already the output of `parseDiffRouteSearch` via the `useSearch` select transform. The `useMemo` at line 760 re-parsed it through the same function with an unsafe `as Record<string, unknown>` cast, producing an identical result. Use `rawSearch` directly instead.
1 parent 1c43bad commit a7a2fae

1 file changed

Lines changed: 1 addition & 5 deletions

File tree

apps/web/src/components/ChatView.tsx

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -757,11 +757,7 @@ export default function ChatView({ threadId }: ChatViewProps) {
757757
composerDraft.interactionMode ?? activeThread?.interactionMode ?? DEFAULT_INTERACTION_MODE;
758758
const isServerThread = serverThread !== undefined;
759759
const isLocalDraftThread = !isServerThread && localDraftThread !== undefined;
760-
const diffSearch = useMemo(
761-
() => parseDiffRouteSearch(rawSearch as Record<string, unknown>),
762-
[rawSearch],
763-
);
764-
const diffOpen = diffSearch.diff === "1";
760+
const diffOpen = rawSearch.diff === "1";
765761
const activeThreadId = activeThread?.id ?? null;
766762
const activeLatestTurn = activeThread?.latestTurn ?? null;
767763
const latestTurnSettled = isLatestTurnSettled(activeLatestTurn, activeThread?.session ?? null);

0 commit comments

Comments
 (0)