From 31b5f779fb4fdd556b41352b29ac61b1f16f9cde Mon Sep 17 00:00:00 2001 From: Daniel Hougaard <62331820+DanielHougaard@users.noreply.github.com> Date: Tue, 13 Feb 2024 20:21:56 +0100 Subject: [PATCH] Frontend bot logic --- frontend/src/views/IntegrationsPage/IntegrationsPage.tsx | 4 ++-- .../components/E2EESection/E2EESection.tsx | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/frontend/src/views/IntegrationsPage/IntegrationsPage.tsx b/frontend/src/views/IntegrationsPage/IntegrationsPage.tsx index fad848b99..cd0fb08dd 100644 --- a/frontend/src/views/IntegrationsPage/IntegrationsPage.tsx +++ b/frontend/src/views/IntegrationsPage/IntegrationsPage.tsx @@ -92,7 +92,7 @@ export const IntegrationsPage = withProjectPermission( isIntegrationsAuthorizedEmpty && isIntegrationsEmpty ) { - if (bot?.id) + if (bot?.id && currentWorkspace?.version === "v1") updateBotActiveStatusSync({ isActive: false, botId: bot.id, @@ -113,7 +113,7 @@ export const IntegrationsPage = withProjectPermission( if (!selectedCloudIntegration) return; try { - if (bot && !bot.isActive) { + if (bot && !bot.isActive && currentWorkspace?.version === "v1") { const botKey = generateBotKey(bot.publicKey, latestWsKey!); await updateBotActiveStatus({ workspaceId, diff --git a/frontend/src/views/Settings/ProjectSettingsPage/components/E2EESection/E2EESection.tsx b/frontend/src/views/Settings/ProjectSettingsPage/components/E2EESection/E2EESection.tsx index 6908c00d6..586f98ac5 100644 --- a/frontend/src/views/Settings/ProjectSettingsPage/components/E2EESection/E2EESection.tsx +++ b/frontend/src/views/Settings/ProjectSettingsPage/components/E2EESection/E2EESection.tsx @@ -20,6 +20,7 @@ export const E2EESection = () => { * 3. Encrypt project key with bot's public key * 4. Send encrypted project key to backend and set bot status to active */ + const toggleBotActivate = async () => { let botKey; try { @@ -75,7 +76,9 @@ export const E2EESection = () => { } }; - return bot ? ( + if (!currentWorkspace) return null; + + return bot && currentWorkspace.version === "v1" ? (

End-to-End Encryption