From ad400fb4f55dee9c72ef253c8061e4a9c65f5f56 Mon Sep 17 00:00:00 2001 From: Antoine Dewez <44063631+Zewed@users.noreply.github.com> Date: Tue, 24 Sep 2024 12:52:33 +0200 Subject: [PATCH] fix(frontend): sync folder for premium users (#3251) # Description Please include a summary of the changes and the related issue. Please also include relevant motivation and context. ## Checklist before requesting a review Please delete options that are not relevant. - [ ] My code follows the style guidelines of this project - [ ] I have performed a self-review of my code - [ ] I have commented hard-to-understand areas - [ ] I have ideally added tests that prove my fix is effective or that my feature works - [ ] New and existing unit tests pass locally with my changes - [ ] Any dependent changes have been merged ## Screenshots (if appropriate): --- .../components/FromConnections/FromConnections.tsx | 4 +++- .../FromConnections/SyncElementLine/SyncElementLine.tsx | 8 ++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/components/FromConnections/FromConnections.tsx b/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/components/FromConnections/FromConnections.tsx index cb07bd839..cdbf8ffc5 100644 --- a/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/components/FromConnections/FromConnections.tsx +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/components/FromConnections/FromConnections.tsx @@ -118,7 +118,9 @@ export const FromConnections = (): JSX.Element => { selectable={!!isPremium || currentProvider === "Notion"} id={folder.id} icon={folder.icon} - isAlsoFile={currentProvider === "Notion"} + isAlsoFile={ + currentProvider === "Notion" ? true : undefined + } /> ))} diff --git a/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/components/FromConnections/SyncElementLine/SyncElementLine.tsx b/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/components/FromConnections/SyncElementLine/SyncElementLine.tsx index d7b743ea5..40b698bc8 100644 --- a/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/components/FromConnections/SyncElementLine/SyncElementLine.tsx +++ b/frontend/app/chat/[chatId]/components/ActionsBar/components/KnowledgeToFeed/components/FromConnections/SyncElementLine/SyncElementLine.tsx @@ -41,7 +41,7 @@ export const SyncElementLine = ({ const [checked, setChecked] = useState(initialChecked); - const showCheckbox: boolean = isAlsoFile ?? !isFolder; + const showCheckbox: boolean = isAlsoFile ?? selectable; const handleSetChecked = () => { setOpenedConnections((prevState) => { @@ -82,11 +82,7 @@ export const SyncElementLine = ({ } }} > -
+
{showCheckbox && (
setIsCheckboxHovered(true)}