From 4a95f936eaa58e34d58fb748a786694edfc27bbc Mon Sep 17 00:00:00 2001 From: Tuan Dang Date: Mon, 21 Aug 2023 17:27:32 +0700 Subject: [PATCH] Correct enable blind-indexing web ui rendering condition --- .../ProjectIndexSecretsSection.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/frontend/src/views/Settings/ProjectSettingsPage/components/ProjectIndexSecretsSection/ProjectIndexSecretsSection.tsx b/frontend/src/views/Settings/ProjectSettingsPage/components/ProjectIndexSecretsSection/ProjectIndexSecretsSection.tsx index df3428d85..dc8f443ba 100644 --- a/frontend/src/views/Settings/ProjectSettingsPage/components/ProjectIndexSecretsSection/ProjectIndexSecretsSection.tsx +++ b/frontend/src/views/Settings/ProjectSettingsPage/components/ProjectIndexSecretsSection/ProjectIndexSecretsSection.tsx @@ -11,16 +11,13 @@ import { useNameWorkspaceSecrets } from "@app/hooks/api"; -// TODO: add check so that this only shows up if user is -// an admin in the workspace - export const ProjectIndexSecretsSection = () => { const { currentWorkspace } = useWorkspace(); const { data: isBlindIndexed, isLoading: isBlindIndexedLoading } = useGetWorkspaceIndexStatus(currentWorkspace?._id ?? ""); const { data: latestFileKey } = useGetUserWsKey(currentWorkspace?._id ?? ""); const { data: encryptedSecrets } = useGetWorkspaceSecrets(currentWorkspace?._id ?? ""); const nameWorkspaceSecrets = useNameWorkspaceSecrets(); - + const onEnableBlindIndices = async () => { if (!currentWorkspace?._id) return; if (!encryptedSecrets) return; @@ -53,7 +50,7 @@ export const ProjectIndexSecretsSection = () => { }); }; - return (!isBlindIndexedLoading && !isBlindIndexed) ? ( + return (!isBlindIndexedLoading && (isBlindIndexed === false)) ? (

Blind Indices