From 2158c03231ec8602ba66b1c2895b923d6fc0289a Mon Sep 17 00:00:00 2001 From: twwu Date: Thu, 29 May 2025 17:53:08 +0800 Subject: [PATCH] fix: update button disabled state to reflect publishedAt status in Popup component --- .../components/rag-pipeline-header/publisher/popup.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx index 62a6adf409..6268e5f63e 100644 --- a/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx +++ b/web/app/components/rag-pipeline/components/rag-pipeline-header/publisher/popup.tsx @@ -33,10 +33,10 @@ const Popup = () => { const { t } = useTranslation() const { datasetId } = useParams() const { push } = useRouter() - const [published, setPublished] = useState(false) const publishedAt = useStore(s => s.publishedAt) const draftUpdatedAt = useStore(s => s.draftUpdatedAt) const pipelineId = useStore(s => s.pipelineId) + const [published, setPublished] = useState(false) const { formatTimeFromNow } = useFormatTimeFromNow() const { handleCheckBeforePublish } = useChecklistBeforePublish() const { mutateAsync: publishWorkflow } = usePublishWorkflow() @@ -125,7 +125,7 @@ const Popup = () => { className='mb-1 w-full hover:bg-state-accent-hover hover:text-text-accent' variant='tertiary' onClick={goToAddDocuments} - disabled={!published} + disabled={!publishedAt} >
@@ -136,7 +136,7 @@ const Popup = () => {