From 492e7ec4dcec8b00bf1019ea4cd3a8b6d20fbcd0 Mon Sep 17 00:00:00 2001 From: "coderabbitai[bot]" <136622811+coderabbitai[bot]@users.noreply.github.com> Date: Sun, 19 Jul 2026 13:19:32 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20CodeRabbit=20CI=20Fix:=20Fix=20f?= =?UTF-8?q?ailing=20CI=20checks=20for=20requirements,=20migrations,=20and?= =?UTF-8?q?=20production=20UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DocumentViewer.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/components/DocumentViewer.tsx b/src/components/DocumentViewer.tsx index fc48ad766..facda1f1b 100644 --- a/src/components/DocumentViewer.tsx +++ b/src/components/DocumentViewer.tsx @@ -2282,11 +2282,11 @@ export function DocumentViewer({ async function summarize() { if (!canSummarizeDocument) { - setSummaryError("Load a source document before summarising."); - return; - } - if (!canUsePrivateApis) { - setSummaryError("Sign in before summarising private documents."); + setSummaryError( + !canUsePrivateApis + ? "Sign in before summarising private documents." + : "Load a source document before summarising.", + ); return; } const summaryMode = sourceSearch.trim().length === 0; @@ -2407,11 +2407,11 @@ export function DocumentViewer({ ? `/?mode=documents&q=${encodeURIComponent(documentDisplayTitle(readyDocument))}&documentId=${encodeURIComponent(documentId)}` : documentHomeHref; const usefulPageHref = (page: number) => documentPageHref(documentId, page); - const canSummarizeDocument = viewerState === "ready" && !loadingSummary && canViewSourceDocuments; + const canSummarizeDocument = viewerState === "ready" && !loadingSummary && canUsePrivateApis; const summarizeTitle = canSummarizeDocument ? "Answer from this document" - : loadingSummary - ? "Answer is generating" + : !canUsePrivateApis + ? "Sign in required to answer from this document" : "Load a source document before answering"; const pageByNumber = useMemo(() => new Map(pages.map((page) => [page.page_number, page])), [pages]); const chunkById = useMemo(() => new Map(chunks.map((chunk) => [chunk.id, chunk])), [chunks]);