From 8bf7eba07b7402b73cbc10910c8d4980817fa5ca Mon Sep 17 00:00:00 2001 From: Akhil Mohan Date: Wed, 13 Dec 2023 11:55:44 +0530 Subject: [PATCH] fix: show popup only for admins --- .../ProjectIndexSecretsSection.tsx | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/frontend/src/views/SecretOverviewPage/components/ProjectIndexSecretsSection/ProjectIndexSecretsSection.tsx b/frontend/src/views/SecretOverviewPage/components/ProjectIndexSecretsSection/ProjectIndexSecretsSection.tsx index 23cfa750d..af2edb0ce 100644 --- a/frontend/src/views/SecretOverviewPage/components/ProjectIndexSecretsSection/ProjectIndexSecretsSection.tsx +++ b/frontend/src/views/SecretOverviewPage/components/ProjectIndexSecretsSection/ProjectIndexSecretsSection.tsx @@ -61,22 +61,24 @@ export const ProjectIndexSecretsSection = ({ decryptFileKey }: Props) => { } }; - return !isBlindIndexedLoading && !isBlindIndexed ? ( -
+ // for non admin this would throw an error + // so no need to render + return !isBlindIndexedLoading && typeof isBlindIndexed === "boolean" && !isBlindIndexed ? ( +
{isIndexing && ( -
+
-
+
Please wait
Re-indexing your secrets...
)}

Enable Blind Indices

-

- Your project was created before the introduction of blind indexing. - To continue accessing secrets by name through the SDK, public API and web dashboard, please enable blind - indexing. This is a one time process. +

+ Your project was created before the introduction of blind indexing. To continue accessing + secrets by name through the SDK, public API and web dashboard, please enable blind indexing.{" "} + This is a one time process.

{(isAllowed) => (